Hi, should always the "version" field be checked when updating a domain class object ? If so, is using a while with sleep an acceptable option ?
+3
A:
Why would you want to check the version? This is maintained automatically by hibernate for optimistic locking. i.e. if the version has changed since you loaded the object any update you flush to the DB will fail.
Normal Grails apps do not need to interact with the version property.
Marc Palmer
2010-03-31 23:33:12
I checked the update actions in the "grails generate-all"-created controllers. There's special care in there if the version is 1. You can check it yourself.
xain
2010-03-31 23:38:05
This is unnecessary in most applications. It is simply useful if you want to pre-empt any concurrent modification issues.You don't need to worry unless you have to deal with providing smarter handling of concurrent change situations.
Marc Palmer
2010-04-01 14:15:35