Open dmkolpakov opened 5 years ago
Description of issue has been updated.
@graemerocher in our project we have the same bug with disabled new dirty checking.
hibernate:
hibernateDirtyChecking: true
I have checked on https://github.com/dmkolpakov/grails-data-mapping-issue-1210 , the bug still exist with hibernateDirtyChecking: true
By the way, looks like unnecessary dirty checking during refreshing:
looks like a big regression. Now refresh() working only in simple cases.
As a workaround (thx @dmkolpakov ) empty method trackChanges
can be added to the parent class
class Parent implements DirtyCheckable {
static hasMany = [child: Child]
void trackChanges() {
// not track changes
}
}
But in this case, as I understand parent class become non-DirtyCheckable
don't use
grails.gorm.default.mapping = {
'*'(accessType: AccessType.PROPERTY)
}
I am also facing same problem.
hibernate: hibernateDirtyChecking: true
did not help. Any update?
After upgrade grails to version to 3.3.9 and GORM version to 6.1.10.RELEASE I've got error during refresh any entity which contains mapping like "hasMany".
Similar problem which I've found here is https://github.com/grails/grails-data-mapping/issues/1096, but no solution was provided.
Link to github(test application): https://github.com/dmkolpakov/grails-data-mapping-issue-1210
Steps for reproduce: Just run provided application from github repository above in HomeController issue will reproduced.
Please pay attention that I've specified access type for properties for entities in application.groovy.
import javax.persistence. grails.gorm.default.mapping = { ''(accessType: AccessType.PROPERTY) }
According my investigation, problem happens because in new version trait DirtyCheckable was added for all domain's entities by default, if we use AccessType.PROPERTY, it invoke setter for certain property and mark entity as dirty, I'm not sure that is right, but more interesting is that hibernate can't proceed with it. I'm going to proceed my investigation, but if you have some thoughts please advise to me.
Exception example:
Task List
Environment Information