2 Replies Latest reply on Jun 13, 2010 7:23 AM by adam.laczynski

    jBPM 4.3 - job is not released when the transaction is marked as rollback only

    adam.laczynski

      Job is not released when the exception occurred during job execution and transaction is marked as rollback only because synchronization cannot be registered in transaction (according to javax.transaction.Transaction#registerSynchronization java doc:  @exception RollbackException Thrown to indicate that the transaction has been marked for rollback only).
      Following exception is thrown:
      org.jbpm.api.JbpmException: couldn't register synchronization: test1
          at org.jbpm.pvm.internal.tx.JtaTransaction.registerSynchronization(JtaTransaction.java:78)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.handleJobExecutionException(ExecuteJobCmd.java:111)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:92)
          at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)
          at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)
          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
          at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
          at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
          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.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:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)

       

      After that, job could be acquired again but only after the lockMillis (default 30 minutes).
      IMO in such case the job has to be released because it delay job execution. To achieve it JobExceptionHandler (with small modification) has to be register before invoking job.execute(...) in org.jbpm.pvm.internal.cmd.ExecuteJobCmd:76. Exception could be passed to the handler in the catch block.

       

      Environment where the problem occurs:
      - WebLogic 10.2.3
      - jbpm 4.3
      - Oracle 10g

       

      Does anybody have similar problem? Is it known issue?