Transaction timeout override reset on threads when CMT transactions run in JBoss EAP 7

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.1

Issue

  • Setting a transaction timeout override (e.g. using Content from docs.oracle.com is not included.UserTransaction.setTransactionTimeout(int)) on a thread.
  • After a Container Managed Transaction (CMT) method completes the override has been reverted to the default transaction timeout.
    • The reversion occurs whether the CMT method starts a new transaction or uses an existing transaction context.
  • A subsequent transaction (BMT or CMT context) on the thread will run with the default transaction timeout.

Resolution

This issue is resolved1 in This content is not included.JBoss EAP 7.2 and later releases.

In earlier releases, re-apply the transaction timeout after CMT methods complete (before starting a new transaction).

Root Cause

This is a known defect in the CMT handling which applies 0 (which is, eventually, translated into the default timeout period) after using the override value.

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.