| Why should Hibernate throw an exception here if you didn't modify the version of the field in the DB? Again, setting the version only works if you call merge on a detached entity, and your test does not reflect that. The current implementation is actually fine, and there's no reason to change it. For more details about why is it so, check out the Concurrency Control section of my Hibernate tutorials. |