2 Replies Latest reply on Mar 10, 2013 1:46 AM by singh_saurabh20

    Deadlocks in the JBPM4_EXECUTION

    sacrm2011

      Hello

       

      I'm having some problems with jBPM4.4.

      My application is currently running on a 3-node cluster using an oracle database 11.2.0.2.0 and am using JBPM 4.4 as an orchestrator of the flow of navigation of the application.

      At the beginning my application had  some problems with competition but not as severe as today, since the load has been increase significantly.

      I'm getting a lot of error messages in my logs:

       

      "2011-12-15 11:00:26,933 ERROR [org.hibernate.util.JDBCExceptionReporter] -  ORA-00060: deadlock detected while waiting for resource

      2011-12-15 11:00:26,934 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] -  Could not synchronize database state with session

      org.hibernate.exception.LockAcquisitionException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#20376624]

          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:110)

          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)

          at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)

          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)

          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)

          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)

          at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:56)

          at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)

          at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)

          at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:57)

          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)

          at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

          at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:89)

          (...) "

       

      Looking in database logs found several sql statements/threads that I suspect are causing the deadlocks:

       

      Query 1:

      "delete from where JBPM4_EXECUTION DBID_ =: = 1 and DBVERSION_: 2;"

       

      Query 2:

      "update JBPM4_EXECUTION set

              DBVERSION_=:1, ACTIVITYNAME_=:2, PROCDEFID_=:3, HASVARS_=:4, NAME_=:5, KEY_=:6, ID_=:7, STATE_=:8, SUSPHISTSTATE_=:9,

              PRIORITY_=:10, HISACTINST_=:11, PARENT_=:12, INSTANCE_=:13, SUPEREXEC_=:14, SUBPROCINST_=:15

      where DBID_=:16 and DBVERSION_=:17; "

       

      Is this a concurrencial problem/limitation of jbpm or something else?

      Any help would be greatly appreciated!

       

       

      Best regards

      Afonso T.

        • 1. Re: Deadlocks in the JBPM4_EXECUTION
          jancrot

          Hi,

           

          I encounter the same problem too.

          My scenario is 20 concurrent users accessing the same block of code.

          Here's the snapshot of the source code:

           

          Execution execution = execService.findExecutionById(processInstanceId);

           

          ProcessInstance rootInstance = getRootProcessInstance(execution);

          String rootInstanceId = rootInstance.getId();

           

          execution = execService.signalExecutionById(processInstanceId, variables);

          boolean rootExecutionCompleted = null == execService.findExecutionById(rootInstanceId);

           

          It's run under Microsoft Windows XP SP2, SQL Server 2008, JBPM4, and Hibernate 3.3.2

          Currently, I'm wondering whether above piece of code is the source of the problem or something else.

           

          Thanks,

          Hendra Jaya

          • 2. Re: Deadlocks in the JBPM4_EXECUTION
            singh_saurabh20

            Hi,

             

            I am facing the same problem too.

            My application is currently using jBPM4.3 + SQL Server 2008.

             

            Any help would be greatly appreciated!

             

            Thanks,

            Saurabh