-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DirtyChecking fails for fields defined in belongsTo #1126
Comments
Looks like the issue is, the setters/field for associations defined in belongsTo doesnt exist when DirtyCheckingTransformer runs. final propertyNodes = classNode.getProperties() above does not return property nodes for those associations defined in belongsTo |
Most probably because the other class was already compiled |
@graemerocher both classses are in same project. What could be the solution here. |
@graemerocher Do you think this is a valid issue, can there be any fix.. or any temporary workaround. |
Seems like a valid issue, but I'm not sure what can me done about it. This would normally occur only if one class is compiled after the other instead of both classes being compiled together |
Ok, i see... In our project, both of the domains are in same project, nothing special about the domains, or build, almost a regular grails project. And still, when i see at decompiled code, i see, a considerable amount of domains has this exact issue. |
Provide an example that reproduces the issue can we can take a look |
@graemerocher the test above is not good enough ? |
@graemerocher Verified and seem to be working good in 6.1.11.BUILD-SNAPSHOT thanks |
I noticed that many of our domain classes doesnt update the record in database and no update query is being fired by hibernate.
Looking in the decompiled code revealed that some of the fields are not marked with DirtyCheckedProperty and the dirty checking code is not weaved into setter.
I noticed that most of the time, the issue is with those associations which are in beoingsTo
So i created following test in grails-data-mapping project
DirtyCheckTransformationSpec
which fails.the assertion fails on line
child.hasChanged("parent")
Gorm version 6.1.x, Grails 3.3.2
The text was updated successfully, but these errors were encountered: