We upgraded our applications from JBoss 4 to JBoss 7. In our persistence.xml file for our applications we have this set:
<property name="hibernate.jdbc.batch_versioned_data" value="true" />
With this property set we are not getting an optimistic lock exception in JBoss 7 when we go to update a stale entity. We had this same issue years ago and fixed it using a patch defined at the below link ( we use Oracle ).
However, this patch is not compatible with the version of Hibernate included in the JBoss 7.1.1 Final application server.
Has anyone seen this and know of an alternative solution?
NOTE: If I set the "batch_versioned_data" property to false the OptimisticLockException is thrown, at the expense of slowing down our batch updates.
Just an update on this.
I was able to port the Oracle "batcher" from the original solution which was compatible with JBoss 4 / Hibernate 3 to JBoss 7 / Hibernate 4. After finding out how to hook a custom "batcher" into Hibernate 4 it was relatively easy.
If you need the solution I can upload it. Let me know.