How to modify the default transaction timeout in JBoss EAP 4.x/5.x
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 4.x
- 5.x
- Red Hat JBoss Enterprise SOA Platform (SOA-P)
- 4.x
- 5.x
- Red Hat JBoss Enterprise Portal Platform (EPP)
- 4.x
- 5.x
Issue
- How do I modify the default transaction timeout?
- Getting
java.io.EOFExceptionafter server runs for more than 8 hours
Resolution
The default transaction timeout is set to 300 seconds (5 minutes) by default. You can change it with following:
Note: The default transaction timeout cannot be changed via the JMX Console while the server is running.
EAP 4.x/SOA-P 4.x/EPP 4.x:
It is contolled by the "TransactionTimeout" attribute of the "jboss:service=TransactionManager" MBean in $JBOSS_HOME/server/$PROFILE/conf/jboss-service.xml:
<!-- JBoss Transactions JTA -->
<mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
name="jboss:service=TransactionManager">
<attribute name="TransactionTimeout">300</attribute>
<attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>
</mbean>
EAP 5.x/SOA-P 5.x/EPP 5.x:
It is contolled by the "transactionTimeout" attribute of the "TransactionManager" bean in $JBOSS_HOME/server/$PROFILE/deploy/transaction-jboss-beans.xml:
<bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
...(snip)...
<property name="transactionTimeout">300</property>
<property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property>
...(snip)...
EJB3
Note that the @TransactionTimeout annotation can also specify a timeout honored by the TransactionReaper. Please also refer to How to specify transaction timeout for CMT EJB in JBoss 4.x/5.x for details about usage of @TransactionTimeout annotation.
EAP 6.x
Please refer to How to change default JTA transaction timeout in JBoss EAP 6.x?.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.