Order of saving when having parent-child relationship between domain classes
If we have domain classes A and B with a parent-child relationship, where class B belongs to class A, which entity should be saved first in Grails?
In service class:
A a;
B b;
func() {
b.save(failOnError :true)
a.save(flush:true , failOnError :true)
}
I am getting NonUniqueKeyException, DublicateKeyException post grails upgrade to v6.2.3
There are no code changes in this code area, just grails upgrade.
Tried to save parent first, but the I am getting unable to insert NULL B.ID