We use Hibernate on backend inside JBoss. We use stateless session beans with a smart client. Hibernate config contains for all entities select-before-update=true and dynamicUpdate = true. We use optimistic locking via a version column per entity.
Still when I use saveOrUpdate on an entity read by the server, transfered to the client, resend to the server, the version counter of the entity is increased every time. If I read the entity server side and save in the same server side thread, the version counter will not be increased.
Background info: we detach the entities from the backend, transfer them to the client, i.e. the saveOrUpdate occurs on a different Hibernate session then the reading.
Is there any way to circument the increasing of the version?
|