I've exactly the same requirement as Marcel. And cannot move away from Sybase Timestamps because of legacy applications.
I wanted to ask, whether Marcel's solution proofed to be successful in the meantime. Are there any efforts to build this into Hibernate or provide an extension point?
Quote:
Clearly, the object cannot be cached after update is performed (unless the new value of timestamp is fetched).
Clearly, no two successive updates of the same object in the same session can happen - the second one must fail due to optimistic concurrency control.
Is there a way to force Hibernate to fetch the DB-generated Timestamp after an update/insert?
What about iterating over all Objects in Interceptor.postFlush() and evict them from the Session and SessionFactory. I think for the Session this requires some tricks because it's not allowed to access the current Session in the Interceptor. And what happens, if the application code keeps a reference to an evicted instance?
Any ideas are welcome.
Ernst