11 Replies Latest reply: Oct 21, 2013 10:48 AM by John Francis RSS

JBoss 7.1.1 Transaction Warnings

gboro54 Novice

We have an application which has an EJB which runs Asyn and is annotated as @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) (I believe this is default behavior but for clarity we have added). When running the application we keep getting the following:

 

12:54:53,696 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffffac124a3d:598c1ee6:502bc969:51 in state  RUN

 

 

 

We have configrued the timeout in the server.xml but I am wondering if I missed something. Any thoughts? I should mention that the Asyn method does the following:

  • Iterates over a large data set from a db
  • Feeds that data into a set of rules
  • Persist some information about the state of the dataset(i.e accumulations of information).

 

I should also mention we sometimes get the following error:

 

 ARJUNA012091: Top-level abort of action 0:ffffac124a3d:598c1ee6:502bc969:4d received TwoPhaseOutcome.FINISH_ERROR from com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord

 

  • 1. Re: JBoss 7.1.1 Transaction Warnings
    Michael Musgrove Master

    We have an application which has an EJB which runs Asyn and is annotated as @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) (I believe this is default behavior but for clarity we have added). When running the application we keep getting the following:

     

    
    12:54:53,696 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffffac124a3d:598c1ee6:502bc969:51 in state  RUN
    

     

     

    This is normal behaviour when the timeout period of your transaction has expired. Try increasing the timeout or decrease the amount of work you perform in your transaction.

  • 2. Re: JBoss 7.1.1 Transaction Warnings
    gboro54 Novice

    I did this in my standalone.xml by doing the following(perhaps it is a misunderstanding of where this should be done)

            <subsystem xmlns="urn:jboss:domain:transactions:1.1">
                <core-environment>
                    <process-id>
                        <uuid/>
                    </process-id>
                </core-environment>
                <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
                <coordinator-environment default-timeout="10000"/>
            </subsystem>
    
    

     

  • 3. Re: JBoss 7.1.1 Transaction Warnings
    Michael Musgrove Master

    Yes that should have worked (but you mean one of the standalone.xml config files - did you change the right one though).

     

    Could you see if setting the timeout via the cli makes any difference:

     

    bin/jboss-cli.sh --connect

    [standalone@localhost:9999 /] /subsystem=transactions/:write-attribute(name=default-timeout,value=10000)

     

    and then read it back to check that it worked:

     

    [standalone@localhost:9999 /] /subsystem=transactions/:read-attribute(name=default-timeout)

     

    and then reboot the server

  • 4. Re: JBoss 7.1.1 Transaction Warnings
    gboro54 Novice

    I ge the following

     

     

     

    [standalone@localhost:9999 /]  /subsystem=transactions/:read-attribute(name=default-timeout)
    {
        "outcome" => "success",
        "result" => 1000000
    }
    
    
    

     

  • 5. Re: JBoss 7.1.1 Transaction Warnings
    Michael Musgrove Master

    Yeah sure but is your transaction still timing out prematurely.

  • 6. Re: JBoss 7.1.1 Transaction Warnings
    gboro54 Novice

    yes

  • 7. Re: JBoss 7.1.1 Transaction Warnings
    Michael Musgrove Master

    Could you produce a simple test case. For example, I had a go at reproducing your issue using the http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/cmt/ AS7 quickstart. I modified src/main/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJB.java to match what I think you have as follows:

     

    @javax.ejb.Asynchronous

    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)

    void createCustomer(String name) throws RemoteException, JMSException {

        try {

                 Thread.sleep(2000);

             } catch (

        etc

    }

     

    The 1 sec sleep is to give time for the transaction to timeout. Then deploy your changes, change the default timeout via the CLI (or standalone-full.xml)

       /subsystem=transactions:write-attribute(name=default-timeout,value=1)

    and then reboot the server.

     

    Now when you invoke this ejb method you should see the transaction timing out and aborting. Look for something similar to the following lines on the console:

     

    14:37:02,172 ERROR [org.jboss.ejb3.invocation] (EJB default - 2) JBAS014134: EJB Invocation failed on component CustomerManagerEJB for method public void org.jboss.as.quickstarts.cmt.ejb.CustomerManagerEJB.createCustomer(java.lang.String) throws java.rmi.RemoteException,javax.jms.JMSException: javax.ejb.EJBTransactionRolledbackException: Transaction rolled back

     

    ....

     

    14:37:02,182 ERROR [org.jboss.as.ejb3] (EJB default - 2) JBAS014102: Asynchronous invocation failed: javax.ejb.EJBTransactionRolledbackException: Transaction rolled back

    If you set the timeout back to the default you will see the transaction commit successfully, thus proving that the default-timeout property works as it should.

  • 8. Re: JBoss 7.1.1 Transaction Warnings
    gboro54 Novice

    I can do this but were you able to reproduce with the above?

  • 9. Re: JBoss 7.1.1 Transaction Warnings
    Michael Musgrove Master

    I made the changes to the quickstart for real and the default-timeout property works as I outlined in my previous post.

     

    So my test case shows that the transaction manager respects the default-timeout property. If you want to see the proof simply repeat my instructions by reading my previous post.

     

    But as I said in the post "I modified CustomerManagerEJB.java to match what I think you have" so it is for you to decide if my test case matches what you are doing in your own application.

  • 10. Re: JBoss 7.1.1 Transaction Warnings
    gboro54 Novice

    What doe you mean by the real?

  • 11. Re: Re: JBoss 7.1.1 Transaction Warnings
    John Francis Newbie

    I had a similar problem and increasing the timeout as suggested above

     

    bin/jboss-cli.sh --connect

    [standalone@localhost:9999 /] /subsystem=transactions/:write-attribute(name=default-timeout,value=10000)



     

    1.         <subsystem xmlns="urn:jboss:domain:transactions:1.1"> 
    2.             <core-environment> 
    3.                 <process-id> 
    4.                     <uuid/> 
    5.                 </process-id> 
    6.             </core-environment> 
    7.             <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/> 
    8.             <coordinator-environment default-timeout="10000"/> 
    9.         </subsystem>   



    Worked fine