Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jta-dev] Definition of active?



On Sun, 13 Nov 2022 at 18:34, Laird Nelson <ljnelson@xxxxxxxxx> wrote:
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."

"A transaction is associated with the target object and it is in the active state. An implementation returns this status after a transaction has been started and prior to a Coordinator issuing any prepares, unless the transaction has been marked for rollback."


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)?

Thanks,
Laird
_______________________________________________
jta-dev mailing list
jta-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jta-dev

Back to the top