5 Replies Latest reply on Apr 16, 2009 9:24 PM by Brad Davis

    JTATransaction Error

    Pedro Alfaro Newbie

      We have a action that fork a process 40,000 times, that works well, but the next activity is a sub-process and for some reason we got the next error:

      16:40:42,547 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id -3f57fd67:920b:49dfad5c:11c invoked while multiple threads active within it.
      16:40:42,548 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action -3f57fd67:920b:49dfad5c:11c aborting with 1 threads active!
      16:40:43,848 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@a33fdf
      16:40:43,852 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      16:40:43,852 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fd67:920b:49dfad5c:11c status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fd67:920b:49dfad5c:11c status: ActionStatus.ABORTED >)
      16:40:43,854 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_40] - Abort called on already aborted atomic action -3f57fd67:920b:49dfad5c:11c
      16:40:43,855 ERROR [JTATransaction] JTA rollback failed
      java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1473)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.rollback(ServerVMClientUserTransaction.java:148)
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:191)
       at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:314)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:227)
       at org.jbpm.svc.Services.close(Services.java:236)
       at org.jbpm.JbpmContext.close(JbpmContext.java:136)
       at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:190)
       at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
      16:40:43,855 ERROR [DbPersistenceService] hibernate rollback failed
      org.hibernate.TransactionException: JTA rollback failed
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:202)
       at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:314)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:227)
       at org.jbpm.svc.Services.close(Services.java:236)
       at org.jbpm.JbpmContext.close(JbpmContext.java:136)
       at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:190)
       at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
      Caused by: java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1473)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.rollback(ServerVMClientUserTransaction.java:148)
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:191)
       ... 6 more
      16:40:43,867 ERROR [Services] problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: hibernate rollback failed
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:231)
       at org.jbpm.svc.Services.close(Services.java:236)
       at org.jbpm.JbpmContext.close(JbpmContext.java:136)
       at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:190)
       at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
      Caused by: org.hibernate.TransactionException: JTA rollback failed
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:202)
       at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:314)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:227)
       ... 4 more
      Caused by: java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1473)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.rollback(ServerVMClientUserTransaction.java:148)
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:191)
       ... 6 more
      16:40:43,867 ERROR [JobExecutorThread] exception in job executor thread. waiting 5000 milliseconds
      org.jbpm.persistence.JbpmPersistenceException: hibernate rollback failed
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:231)
       at org.jbpm.svc.Services.close(Services.java:236)
       at org.jbpm.JbpmContext.close(JbpmContext.java:136)
       at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:190)
       at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)
      Caused by: org.hibernate.TransactionException: JTA rollback failed
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:202)
       at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:314)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:227)
       ... 4 more
      Caused by: java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1473)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.rollback(ServerVMClientUserTransaction.java:148)
       at org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:191)
       ... 6 more
      


      Process definition
       <node name="process-data-drop">
       <action class="com.ldg.dpm.wf.action.common.ProcessDataDropActionHandler" /><!-- This action fork the process 40,000 times -->
       <transition to="data-process" name="to-data-process"></transition>
       <transition to="wait-for-all-data-process-finish" name="to-wait-for-all-data-process-finish"></transition>
       </node>
       <!-- the action finish well, but after that we got a JTA exception -->
       <process-state name="data-process" async="true">
       <sub-process name="fdc_data_process" binding="late"/>
       <variable name="_provider_name"></variable>
       <variable name="_file_name"></variable>
       <variable name="_line_number"></variable>
       <variable name="_line"></variable>
       <transition to="end-data-process"></transition>
       </process-state>



      Could you help me with some ideas to fix this problem?
      Thanks


        • 1. Re: JTATransaction Error
          Ronald van Kuijk Master

          what does the actionhandler do exactly?

          and 40.000 times??? wow... That does not sound like workflow

          • 2. Re: JTATransaction Error
            Pedro Alfaro Newbie

            We are trying to use jbpm to manage file processing.
            1.- the flow detect that there is a new file.
            2.- create a process to manage the file, in an action read the file and create a child process for each row in the file.
            3.- the father process goes to a waiting state and the child to a sub-process to be processed.
            4.- when all the childs come back from the sub-process, the father process goes to end.

            This implementation works well with small number of child processes(10, 100, 1000).
            I think the problem is when jbpm create the sub-process.

            • 3. Re: JTATransaction Error
              Pedro Alfaro Newbie

              Next is the code that I am using to fork the main process

               public static ExecutionContext forkToken(ExecutionContext executionContext, String tokenName) throws Exception {
               final Token rootToken = executionContext.getToken();
               final Token newToken = new Token( rootToken, tokenName );
              
               newToken.setTerminationImplicit( true );
               executionContext.getJbpmContext().getSession().save( newToken );
              
               ExecutionContext newExecutionContext = new ExecutionContext( newToken );
              
               return newExecutionContext;
               }



              • 4. Re: JTATransaction Error
                Pedro Alfaro Newbie

                Thanks for your help!!!

                • 5. Re: JTATransaction Error
                  Brad Davis Novice

                  Your fork 40,000 times will run in one transaction unless you make the subprocess run asynchronously.


                  Thus, I would imagine that your transaction is timing out to cause this exception... as 40000 processes would take a lot of time to spin up.

                  When the transaction times out, the next would say, wait there is no transaction active!

                  B