2 Replies Latest reply on Aug 9, 2010 1:39 AM by Prachi M

    JBPM4.3 jobExecutor threads cause database deadlock exception

    Zengping Tian Newbie

      Hi

       

      We're trying to run jbpm4.3 + db2, but jobExecutor threads cause database deadlock exception

       

      Any one has similar experience?

       

      Thanks in advice

       

       

      8:37:17,310 SEV                 | [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.LockAcquisitionException: pool-1-thread-1: could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#69]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:105)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2466)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2340)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2653)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
      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:168)
      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:1028)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)
      at $Proxy0.flush(Unknown Source)
      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:61)
      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:55)
      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
      at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 2
      at com.ibm.db2.jcc.a.lg.e(lg.java:1600)
      at com.ibm.db2.jcc.b.gb.s(gb.java:859)
      at com.ibm.db2.jcc.b.gb.k(gb.java:387)
      at com.ibm.db2.jcc.b.gb.a(gb.java:60)
      at com.ibm.db2.jcc.b.w.a(w.java:52)
      at com.ibm.db2.jcc.b.wb.b(wb.java:202)
      at com.ibm.db2.jcc.a.mg.ab(mg.java:1794)
      at com.ibm.db2.jcc.a.mg.d(mg.java:2342)
      at com.ibm.db2.jcc.a.mg.W(mg.java:463)
      at com.ibm.db2.jcc.a.mg.executeUpdate(mg.java:446)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2448)
      ... 29 more

        • 2. Re: JBPM4.3 jobExecutor threads cause database deadlock exception
          Prachi M Newbie

          Hi Zengping,

           

          I am facing the same issue with jBPM 4.3 + Tomcat 6.0 + DB2 environment.

          The stack trace says:

           

           

          org.jbpm.api.JbpmException: couldn't extract bytes out of blob org.jbpm.pvm.internal.lob.BlobStrategyBlob.get(BlobStrategyBlob.java:27) org.jbpm.pvm.internal.lob.Lob.extractBytes(Lob.java:102) org.jbpm.pvm.internal.repository.DeploymentImpl.getBytes(DeploymentImpl.java:182) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197) org.jbpm.pvm.internal.repository.DeploymentImpl_$$_javassist_29.getBytes(DeploymentImpl_$$_javassist_29.java) org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:62) org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46) org.jbpm.pvm.internal.repository.RepositorySessionImpl.getObject(RepositorySessionImpl.java:129) org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:72) org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:71) org.jbpm.pvm.internal.query.AbstractQuery.untypedUniqueResult(AbstractQuery.java:75) org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.uniqueResult(ProcessDefinitionQueryImpl.java:145) org.jbpm.pvm.internal.repository.RepositorySessionImpl.findProcessDefinitionByKey(RepositorySessionImpl.java:153) org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:58) org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38) org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45) org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:55) org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55) org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70) com.ms.msqe.trmworkflow.bpm.service.impl.WorkflowServiceImpl.submitRelease(WorkflowServiceImpl.java:93) com.ms.msqe.trmworkflow.controllerservlet.SubmitReleaseController.onSubmit(SubmitReleaseController.java:56) org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:272) org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268) org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

           

          root cause

           

          com.ibm.db2.jcc.b.SqlException: [jcc][10120][11936][3.53.95] Invalid operation: Lob is closed. ERRORCODE=-4470, SQLSTATE=null com.ibm.db2.jcc.b.bd.a(bd.java:660) com.ibm.db2.jcc.b.bd.a(bd.java:60) com.ibm.db2.jcc.b.bd.a(bd.java:94) com.ibm.db2.jcc.b.ce.d(ce.java:67) com.ibm.db2.jcc.b.ce.r(ce.java:56) com.ibm.db2.jcc.b.ce.length(ce.java:41) org.hibernate.lob.SerializableBlob.length(SerializableBlob.java:54) org.jbpm.pvm.internal.lob.BlobStrategyBlob.get(BlobStrategyBlob.java:25) org.jbpm.pvm.internal.lob.Lob.extractBytes(Lob.java:102) org.jbpm.pvm.internal.repository.DeploymentImpl.getBytes(DeploymentImpl.java:182) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197) org.jbpm.pvm.internal.repository.DeploymentImpl_$$_javassist_29.getBytes(DeploymentImpl_$$_javassist_29.java) org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:62) org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46) org.jbpm.pvm.internal.repository.RepositorySessionImpl.getObject(RepositorySessionImpl.java:129) org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:72) org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:71) org.jbpm.pvm.internal.query.AbstractQuery.untypedUniqueResult(AbstractQuery.java:75) org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.uniqueResult(ProcessDefinitionQueryImpl.java:145) org.jbpm.pvm.internal.repository.RepositorySessionImpl.findProcessDefinitionByKey(RepositorySessionImpl.java:153) org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:58) org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38) org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45) org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:55) org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55) org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70) com.ms.msqe.trmworkflow.bpm.service.impl.WorkflowServiceImpl.submitRelease(WorkflowServiceImpl.java:93) com.ms.msqe.trmworkflow.controllerservlet.SubmitReleaseController.onSubmit(SubmitReleaseController.java:56) org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:272) org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268) org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

           

           

          Please provide some pointers. Did you resolve the problem?

           

          Thanks,

          Prachi