IJ000460: Error checking for a transaction : Transactions are not active

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6

Issue

  • IJ000460: Error checking for a transaction - status may be:
    • ActionStatus.COMMITTED
    • ActionStatus.ABORTED
    • ActionStatus.ABORT_ONLY
... java.sql.SQLException: javax.resource.ResourceException: IJ000460: Error checking for a transaction
    ...
Caused by: javax.resource.ResourceException: IJ000460: Error checking for a transaction
    ...
Caused by: javax.resource.ResourceException: IJ000459: Transaction is not active: ... <transaction-id-here> ... ActionStatus.COMMITTED >
    ...
  • IJ000460 may be associated with SQL Error: 0, SQLState: null
  • IJ000460 may be wrapped by javax.ejb.EJBTransactionRolledbackException

Resolution

Depending on the exact error, the following steps may apply

  • Investigate application code to determine why the application is trying to reuse a transaction which has previously been terminated
  • Review the logs for instances of transaction abort/timeout warnings
    • If using UserTransaction for bean managed transactions (BMT), ensure that the application code calls UserTransaction.rollback() explicitly after encountering a timed out transaction in order to ensure that the transaction is cleared from the thread.
  • Check for unhandled exceptions in application code that may result in an implicit rollback which aborts the transaction
    • See Diagnostics

Root Cause

The application is trying to use a transaction which has either been committed, rolled back or marked for rollback.

Diagnostic Steps

  • Enable transaction TRACE
    • Look for calls to setRollbackOnly() and preventCommit(...) and find the transaction ID
... TRACE [com.arjuna.ats.jta] (<thread-id-here>) TransactionImple.setRollbackOnly
...
... TRACE [com.arjuna.ats.arjuna] (<thread-id-here>) BasicAction::preventCommit( BasicAction: 0:ffff0a07b396:-2eec8453:56370c77:d78ac2 status: ActionStatus.RUNNING)
  • Search the server/application logs for previous references to the transaction ID mentioned in the IJ000459 message
... IJ000459: Transaction is not active: tx=TransactionImple ... 0:ffff0a07b396:-2eec8453:56370c77:d78ac2 ...
  • Look for log entries like the below which are usually found when an exception is not handled by application code and JBoss is forced to rollback the transaction
... ERROR [org.jboss.as.ejb3.invocation] (<thread-id-here>) JBAS014134: EJB Invocation failed on component <ejb-name-here> for method <method-here>: javax.ejb.EJBException: <causal-exception-here>
  • Use the below Byteman rule to trace calls to setRollbackOnly() (e.g. in cases where the transaction is reported as ActionStatus.ABORTED or ActionStatus.ABORT_ONLY)
RULE JtaSetRollbackOnly
CLASS com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple
METHOD setRollbackOnly
IF true
DO traceStack("[BYTEMAN] ");
ENDRULE

RULE JtsSetRollbackOnly
CLASS com.arjuna.ats.internal.jta.transaction.jts.TransactionImple
METHOD setRollbackOnly
IF true
DO traceStack("[BYTEMAN] ");
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.