panda wrote:
Hy,
we are loading an object into the session, updating some values including version attribute, and commtting it (container managed transaction) in a Stateless Session Bean
We tried it without calling dao.update too, because Hibernate checks if an object is dirty and persists it automatically into the DB. But the version check faild in both ways.
Why are you changing the version attribute in your code ? You shouldn;t be touching this. Hibernate decides on whether to change this or not by ( I think) introspecting or using CGLIB to detect changes between the the database and local copy of the data.
A guaranteed way of you resolving your problem is just to step through the hibernate code using your debugger. I had the same problem (sorry I have no memory of what caused it) but it was easy enough to fix in debug.