-
1. Re: JBoss 7.1.1 Transaction Warnings
mmusgrov Aug 17, 2012 12:01 PM (in response to gboro54)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 Aug 17, 2012 12:03 PM (in response to mmusgrov)I did this in my standalone.xml by doing the following(perhaps it is a misunderstanding of where this should be done)
{code:xml}
<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>
{code}
-
3. Re: JBoss 7.1.1 Transaction Warnings
mmusgrov Aug 17, 2012 12:37 PM (in response to gboro54)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 Aug 17, 2012 12:40 PM (in response to mmusgrov)I ge the following
{code}
[standalone@localhost:9999 /] /subsystem=transactions/:read-attribute(name=default-timeout)
{
"outcome" => "success",
"result" => 1000000
}
{code}
-
5. Re: JBoss 7.1.1 Transaction Warnings
mmusgrov Aug 17, 2012 1:03 PM (in response to gboro54)Yeah sure but is your transaction still timing out prematurely.
-
-
7. Re: JBoss 7.1.1 Transaction Warnings
mmusgrov Aug 20, 2012 9:56 AM (in response to gboro54)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 Aug 20, 2012 10:02 AM (in response to mmusgrov)I can do this but were you able to reproduce with the above?
-
9. Re: JBoss 7.1.1 Transaction Warnings
mmusgrov Aug 21, 2012 12:56 PM (in response to gboro54)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 Aug 21, 2012 12:20 PM (in response to mmusgrov)What doe you mean by the real?
-
11. Re: Re: JBoss 7.1.1 Transaction Warnings
mrjazzy Oct 21, 2013 10:48 AM (in response to mmusgrov)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)
- <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>
Worked fine