I searched for the word "active" in the JTA specification
. It appears twelve times, and only within section 3.8
(on the TransactionScoped
annotation). That section also says: "It is not intended that the term “active” as defined here in relation to the TransactionScoped annotation should also apply to its use in relation to transaction context, lifecycle, etc. mentioned elsewhere in this specification." However, surprisingly, it does not actually appear anywhere else in the specification.
In the javadoc for Transaction, "inactive" appears five times ("active" appears zero), but is never defined.
In the javadoc for TransactionManager, "active" does not appear.
In the javadoc for TransactionSynchronizationRegistry, "active" appears seven times, but is never defined.
In the javadoc for UserTransaction, "active" does not appear.
Finally and obviously there is a Status.STATUS_ACTIVE field, and its javadoc says "A transaction is associated with the target object and it is in the active state."
Do I understand properly from all of this that it must follow that a transaction is active if and only if, at a given moment in time, calls to TransactionManager#getStatus(), Transaction#getStatus(), UserTransaction#getStatus() and TransactionSynchronizationRegistry#getTransactionStatus() return Status.STATUS_ACTIVE and no other status? And that therefore the undefined term "inactive" found in Transaction's javadoc means any other status code (including, I suppose, possibly undefined ones)?