richard orama
New member
I am developing my first Grails application using MySQL. I have 2 development computers - one at home and another in the office. I am having an issue with deletes.
Among others, I have 2 associated domains:
class Specimen {
...
static hasMany = [patienttbdrug: PatientTBDrug, requestreason: RequestReason, patienttest: PatientTest]
static belongsTo = [patient: Patient, facility: Facility, patientcategory: PatientCategory, receivedby: Staff]
...
}
and
class Facility {
...
static belongsTo = [district: District]
static hasMany = [specimen: Specimen]
static mapping = {
specimen cascade: "save-update"
}
...
}
On the home computer all is perfect because when I try to delete a facility which has specimens, it fails to delete because of the children - note that cascade delete is off. This is good. However, using exactly the same application and data/database on the office computer, when I try to delete a facility which has specimens, the facility gets deleted and leaves the children (specimens) intact (orphaned).
Any general thoughts on what could be causing this - is it some differences in MySQL configuration, etc?
Thanks.
Among others, I have 2 associated domains:
class Specimen {
...
static hasMany = [patienttbdrug: PatientTBDrug, requestreason: RequestReason, patienttest: PatientTest]
static belongsTo = [patient: Patient, facility: Facility, patientcategory: PatientCategory, receivedby: Staff]
...
}
and
class Facility {
...
static belongsTo = [district: District]
static hasMany = [specimen: Specimen]
static mapping = {
specimen cascade: "save-update"
}
...
}
On the home computer all is perfect because when I try to delete a facility which has specimens, it fails to delete because of the children - note that cascade delete is off. This is good. However, using exactly the same application and data/database on the office computer, when I try to delete a facility which has specimens, the facility gets deleted and leaves the children (specimens) intact (orphaned).
Any general thoughts on what could be causing this - is it some differences in MySQL configuration, etc?
Thanks.