3 Replies Latest reply on Jan 29, 2009 10:36 PM by Meghana Joglekar

    Row lock contentions on BPEL_FROM

    Meghana Joglekar Novice

      Hello,

      We are using JBPM 3.2 and BPEL extension 1.1GA. It is using Oracle as backend and running quite a bit of load. We are seeing row lock contentions on BPEL_FROM table a lot. The one query we see multiple times is -

      update BPEL_FROM set ELEMENT_=:1 where ID_=:2


      After investigating further, we found that due to Hibernate's auto flushmode, BPEL_FROM table records are updated every time flush is called. However the data of these records never change in reality.

      After adding the mutable="false" flag on From.hbm.xml file, these queries are not run anymore. However we would like to know if it is safe change to make. Was it by design that the rows get updated everytime or is it a bug and we should create JIRA issue for it?

      Thank you,
      Meghana

        • 1. Re: Row lock contentions on BPEL_FROM
          Alejandro Guizar Master

          No, it is a bug. The BPEL_FROM table is supposed to be immutable once the process gets saved to the database. However the element type is mutable, and Hibernate probably does not know enough to realize the element did not change. Please do file the jira issue.

          • 2. Re: Row lock contentions on BPEL_FROM
            Meghana Joglekar Novice

            Thanks for your reply.

            When we tried setting mutable="false" on the hbm.xml file itself, in some cases, it resulted in exception

            INFO | jvm 1 | 2009/01/29 22:21:08 | java.lang.NullPointerException
            INFO | jvm 1 | 2009/01/29 22:21:08 | at org.jbpm.bpel.graph.basic.assign.FromVariable.extract(FromVariable.java:44)
            INFO | jvm 1 | 2009/01/29 22:21:08 | at sun.reflect.GeneratedMethodAccessor310.invoke(Unknown Source)
            INFO | jvm 1 | 2009/01/29 22:21:08 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            


            This was running on JBoss 4.0.5GA with Hibernate 3.2.0GA jars. On other server where we were running newer version of Hibernate, it seemed to work ok.

            There is one more thing we tried is creating new ElementType, just for ELEMENT_ column of this table and changed its equals method to always return true. When hibernate calls 'IsDirty' on various objects, this type always says not dirty. After this it didn't run that query anymore. Changing the isMutable method of this new class to return false did not have exact same effect, though it reduced the number of queries.

            Can you please suggest what is the right approach to fix this locally for us? The flag on hbm.xml file seemed to be the right one until we got that exception.

            I will be filing JIRA issues shortly.

            Thanks,
            Meghana