I'm running Hibernate 3.2.1 GA. I have an object which has in it's mapping
<version name="foo" generated="always" type="timestamp"/>
It appears that the generated="always", which based on the documentation tells Hibernate that the value is generated by the underlying DB isn't working as I get the following debug log entry on attempting to flush the modified object:
DEBUG hibernate.engine.Versioning:27 - Incrementing: 2006-12-14 09:39:03 to 2006-12-14 10:15:54
Which leads to:
Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
I'm using saveOrUpdate to notify Hibernate of the need to persist the changes.
I've looked at the open bugs list, I did not find any bugs that seemed to be directly related.
Any help is appreciated.
UPDATE: setting generated="never" still results in a version increment but not an exception.
|