Skip to main content

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

I take the viewpoint that the JTA spec should be read in conjunction with the OMG OTS specification, on which JTA is based. The definition is:

Active means "The state of a transaction when processing is in progress and completion of the transaction has not yet commenced.".

That said, I agree that one could argue that including the state model in the JTA spec could be a useful addition.

On Sun, Nov 13, 2022 at 6:34 PM 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."

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


--
Michael Musgrove

JBoss, by Red Hat
Registered Address: Red Hat Ltd, 6700 Cork Airport Business Park, Kinsale Road, Co. Cork.
Registered in the Companies Registration Office, Parnell House, 14 Parnell Square, Dublin 1, Ireland, No.304873
Directors:Michael Cunningham (USA), Vicky Wiseman (USA), Michael O'Neill, Keith Phelan, Matt Parson (USA)



Back to the top