Transaction timeout precedence in JBoss EAP
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7
- 6
- 5
- JBoss Transactions
- JBoss EJB3
@TransactionTimeout()annotation
- This content is not included.EAP 5 Datasource Parameters / This content is not included.EAP 6 Datasource Parameters
set-tx-query-timeoutquery-timeoutxa-resource-timeout
- This content is not included.EAP 5 Transaction Timeout Handling / This content is not included.EAP 6 Transaction Timeout Handling
- This content is not included.Transaction Timeouts
com.arjuna.ats.jts.defaultTimeoutcom.arjuna.ats.arjuna.coordinator.txReaperTimeout
- This content is not included.Transaction Timeouts
Issue
- What timeouts can affect a transaction?
- What can cause a timeout?
- Is there a transaction timeout defined in the transaction manager
Resolution
There is no precedence or hierarchy in timeouts relating to a transaction. The smallest value in scope will cause a timeout. Typically the smallest value would be query-timeout.
Timeouts can be caused by network latency, external systems response time, failure of external systems and broken communication channels.
Driver Level
- Content from docs.oracle.com is not included.Statement Timeout set on the
java.sql.Statement- Called by setting the following, but result of call is dependent upon driver implementation
- If the datasource parameter
set-tx-query-timeoutistruethen query timeout will be based on the time remaining until transaction timeout.
- If the datasource parameter
- Called by setting the following, but result of call is dependent upon driver implementation
Resource Manager (RM)
- Content from docs.oracle.com is not included.TransactionTimeout set on the
javax.transaction.xa.XAResource- last invocation on the XAResource wins
- possibly out of scope due to dependency on RM settings (such as a participating database)
Transaction Service (TS)
com.arjunauses the following to setRollbackOnly on thejavax.transaction.xa.XAResourcecom.arjuna.ats.jts.defaultTimeout- Content from docs.oracle.com is not included.TransactionTimeout set on the
javax.transaction.xa.XAResource- last invocation on the XAResource wins
- Content from docs.oracle.com is not included.TransactionTimeout set on the
com.arjuna.ats.arjuna.coordinator.txReaperTimeout- used by the
com.arjunaTS in order to set a transaction to RollbackOnly - modified in
jbossts-properties.xml
- used by the
- See Transaction abort and timeout messages for recommendations regarding transaction timeout configuration (per-transaction and global).
Network & Database Server Level
- External (e.g. firewall or database server) timeout policy may interrupt/abort activity on connections which may lead to transaction failure
- A database server initiated timeout of transactions may also impact transaction behavior
- Noted for reference, out of scope for discussion
Diagnostic Steps
The Byteman rule below can be used to trace cases where statement timeout is set:
RULE java.sql.Statement.
INTERFACE java.sql.Statement
METHOD setQueryTimeout
IF TRUE
DO traceStack("[BMAN] Statement.setQueryTimeout(" + $1 + ")\n");
ENDRULE
Components
Category
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.