7 Replies Latest reply on Apr 5, 2012 4:22 PM by lafr

    TransactionTimeout NoOp?

    lafr

      Is the annotation org.jboss.ejb3.annotation.TransactionTimeout still a NoOp in AS 7.1.2-SNAPSHOT like written in https://community.jboss.org/message/593587 one year ago?

       

      I have some long running SLSB methods like in the example below. This worked perfect with AS 6.1 and 4.2.x.

       

      The method called by a timer has this annotation, but after 5 minute, the default transaction timeout, I see in my server.log

      16:00:00,013 WARN  [com.arjuna.ats.arjuna#check] ARJUNA012117: TransactionReaper::check timeout for TX 0:ffffac1f1201:51ca1a78:4f671898:1f8 in state  RUN

      16:00:00,148 WARN  [com.arjuna.ats.arjuna#doCancellations] ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffffac1f1201:51ca1a78:4f671898:1f8

       

      The operation is continuing until finished and then I get an exception with a stacktrace.

      Then the time retry occurs and the method is run another time with the same problems.

      Luckily only one retry occurs.

       

      16:37:06,392 WARN  [com.arjuna.ats.arjuna#Abort] ARJUNA012077: Abort called on already aborted atomic action 0:ffffac1f1201:51ca1a78:4f671898:7a396

      16:37:06,527 ERROR [org.jboss.as.ejb3#run] JBAS014122: Error during retrying timeout for timer: [id=b4afbf9d-e241-4520-90b7-3c55f65c1408 timedObjectId=maj2e-langfr-dev.ejb-session-sales.MbiEdajoEraser auto-timer?:false persistent?:false timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@423a85 initialExpiration=Mon Mar 19 15:55:00 CET 2012 intervalDuration(in milli sec)=0 nextExpiration=null timerState=RETRY_TIMEOUT: javax.ejb.EJBTransactionRolledbackException: Transaction rolled back

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleEndTransactionException(CMTTxInterceptor.java:115) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:95) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.tx.TimerCMTTxInterceptor.endTransaction(TimerCMTTxInterceptor.java:66) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]

          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:111) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.timerservice.task.TimerTask.callTimeout(TimerTask.java:157) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.timerservice.task.TimerTask.retryTimeout(TimerTask.java:184) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:140) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_31]

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_31]

          at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_31]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]

          at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]

      Caused by: javax.transaction.RollbackException: ARJUNA016063: The transaction is not active!

          at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1155) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117) [jbossjts-4.16.2.Final.jar:]

          at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92) [jboss-as-ejb3-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

          ... 26 more

       

      @Stateless

      public class MbiEdajoEraser extends EraserBase

      {


      @Timeout

      @TransactionTimeout(value = 3600)

      protected void ejbTimeout( final Timer timer )

      {

      // Query

      results = query.getResultList();
              MbiEdajoEraser mbiEdajoEraser = this.sessionContext.getBusinessObject( MbiEdajoEraser.class );
              for ( Object edajoSerial : results ) {
                  mbiEdajoEraser.removeEntry(  edajoSerial );
                  rowsDeleted++;
              }
      }

       

       

      @TransactionAttribute( TransactionAttributeType.REQUIRES_NEW )
      MbiEdajo mbiEdajo = this.entityManager.find( MbiEdajo.class, key );
          this.entityManager.remove( mbiEdajo );
      }
        • 1. Re: TransactionTimeout NoOp?
          sfcoy

          Is it not working in 7.1.1?

           

          It's certainly documented at EJB 3 Reference Guide.

          • 2. Re: TransactionTimeout NoOp?
            lafr

            No, does not work for me using 7.1.2.Final-SNAPSHOT.

            Even not when specifying the unit, as 3600 SECONDS or 1 HOURS.

            With or without TransactionTimeout does not make a difference for me.

            The SLSB itself has no TransactionAttribute defined, so it should default to REQUIRED.

            • 3. Re: TransactionTimeout NoOp?
              lafr

              I answer to myself: the annotation does not work, if the annotated method is protected or private. It works, when the method is public.

              Using JBossAS 6.x before it worked in both cases.

               

              Bug or Feature? I don't know.

              I'll change the signature of my methods back to public.

              • 4. Re: TransactionTimeout NoOp?
                jaikiran

                Frank Langelage wrote:

                 

                I answer to myself: the annotation does not work, if the annotated method is protected or private. It works, when the method is public.

                 

                That annotation like other annotations is meant for business interface methods and business interface methods are expected to be public

                • 5. Re: TransactionTimeout NoOp?
                  sfcoy

                  jaikiran pai wrote:

                   

                  ...

                   

                  That annotation like other annotations is meant for business interface methods and business interface methods are expected to be public

                   

                  That could be considered to be an unnecessarily harsh restriction, considering that @TransactionAttribute is permitted to be applied to timeout callback methods, which in turn are permitted to have "public, private, protected, or package level access".

                  • 6. Re: TransactionTimeout NoOp?
                    jaikiran

                    Stephen Coy wrote:

                     

                    jaikiran pai wrote:

                     

                    ...

                     

                    That annotation like other annotations is meant for business interface methods and business interface methods are expected to be public

                     

                    That could be considered to be an unnecessarily harsh restriction, considering that @TransactionAttribute is permitted to be applied to timeout callback methods, which in turn are permitted to have "public, private, protected, or package level access".

                    Good point, I hadn't considered container invoked methods in my reply. Please file a JIRA if the annotation isn't working for container invoked methods with non-public access qualifier.

                    • 7. Re: TransactionTimeout NoOp?
                      lafr