1 Reply Latest reply on Nov 26, 2013 9:34 PM by javacoryd

    JBoss 7.1.1 Final / OptimisticLockException not happening

    javacoryd

      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 ).

       

      https://hibernate.atlassian.net/i#browse/HHH-3360

       

      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.

       

      Thanks,

       

      Cory.

        • 1. Re: JBoss 7.1.1 Final / OptimisticLockException not happening
          javacoryd

          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.

           

          Cory.