Set the remote EJB transaction timeout in JBoss EAP 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6.4.5 and later
Issue
- Using distributed transactions with EJB remoting
- Remote transaction branches do not appear to timeout
Resolution
In EAP 6.4.5 and later, the remote branch transaction timeout period default may be overridden explicitly on a per-jvm basis by setting the system property org.jboss.as.ejb3.remote-tx-timeout to a value in seconds.
Note that transaction timeout does not interrupt running threads.
Root Cause
Transaction timeout for remote transaction branches cannot be configured dynamically.
- In EAP 6.x releases prior to 6.4.0, the remote branch transaction timeout period was hardcoded to 300 seconds (5 minutes)
- In EAP 6.4.0 through 6.4.4, the remote branch transaction timeout period was hardcoded to Integer.MAX_VALUE seconds
- In EAP 6.4.5 and later, the remote branch transaction timeout period defaults to 31536000 (one year in seconds) but can be statically overridden
A similar limitation is observed when using EJBClient (e.g. from a pure-Java application).
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.