I have the same problem with version 3.0.5 et 3.1.2.
My french Post with a junit test.
Translation (Thanks Thierry) :
I’m trying to use the automatic versioning in detached mode as described in chapter 11.3.3.
(
http://www.hibernate.org/hib_docs/v3/re ... c-detached)
Here’s my problem:
When I create a new person, the version is set to 0.
During a save, it is set to 1.
Everything is normal so far.
If I try to save the object with a version set to 0, I expect to get an exception, but I don’t get it! Nevertheless no change is performed in the database.
Watching the SQL code, I realize it tries to update a non-existent row, but I’m not informed there has not been any modification
update Person set version=1 where name='Gavin' and version=0
I certainly forgot a parameter, but which one???
To illustrate the case, I added the following test method in the class org.hibernate.test.version.VersionTest