-
Notifications
You must be signed in to change notification settings - Fork 62
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
automatic dirty checking not working on array type #106
Comments
Don't have an answer but I recently discovered and fixed a similar dirty checking issue with It might give you some hints where the dirty checking mechanism fails. I would say that if something changed in Hibernate that it now compares by reference and not value the indeed this would explain your problem. |
Hi. Dirty-checking has changed and been improved on Gorm 6.1. You can see an explanation by Graeme on how it works here: grails/grails-data-mapping#961 |
I have observed the same missing drty-checking on Map types (JSON). As a temporary work-around, I forcibly modify another field of the Domain instance to make sure the save is performed :
|
I also encountered this issue. Setting a Map property via setter internally calls markDirty but when using leftShift operator to add add some stuff to the map this would not work.
|
Have also the same problem with Gorm 6.1.x. Also with Map type. |
If you want a collection to be dirty checked you will have to call the setter or manually set markDirty() on the instance. I am using the first variant so I have not too much framework-specific code within my classes. |
In a grails app I have a domain class like this:
This used to work when using:
org.grails.plugins:postgresql-extensions:4.6.2
grails version 3.2.8
gorm version 6.0.9.RELEASE
This stopped working when using:
grails version 3.2.9
gorm version 6.1.4.RELEASE
I think the reason is some change in the new gorm version. It stops working since version gorm 6.1.0
Also using the org.grails.plugins:postgresql-extensions:5.1.0 did not change it.
The workaround was to add a markDirty() in the convenience method:
Any Hints?
Thx
The text was updated successfully, but these errors were encountered: