An action updatein Grails first checks the version of the updated object and then updates it. What part of Grails ensures that the object is not updated by another request while checking the version and updating the object?
Update:
Yes, hibernate will check the version, when it smoothes an object and throws an exception, optimization of the lock is not performed. And I think hibernate will verify that validation + update is atomic, but ...
if you look at the method of generating the generated Grails, you will find that the first double checks of grails and then (from my point of view) are not ready to handle the exception. The probability that hibernate will throw an exception after the update method has already checked the correct version is small, but it seems to me that this is possible.
So wouldn’t it be enough to try to save and catch the exception (if any)?
source
share