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 Mon, Nov 14, 2022 at 8:50 PM Laird Nelson <ljnelson@xxxxxxxxx> wrote:
On Mon, Nov 14, 2022 at 11:50 AM Michael Musgrove <mmusgrov@xxxxxxxxxx> wrote:
That makes sense, there is only one logical (or actual) coordinator and the transaction is active (modulo ROLLBACK_ONLY) up until the point that the coordinator is instructed to start the 2PC part of the model.

The "modulo ROLLBACK_ONLY" interests me because it seems to come into play with TransactionSynchronizationRegistry#getResource(Object).  There, for the call to complete successfully, the transaction must be "active" in the sense of  your "active (modulo ROLLBACK_ONLY)" (maybe you actually mean modulo Status.MARKED_FOR_ROLLBACK, since there is no Status.STATUS_ROLLBACK_ONLY?).

In other words, it is legal for someone to call TransactionSynchronizationRegistry#getResource(Object) when the current transaction's state is Status.STATUS_MARKED_ROLLBACK, or Status.STATUS_ACTIVE.  So "active" must encompass both of these states in this particular usage, yes?  Either that or Narayana got it wrong, which I highly doubt.

So would updating the javadoc to the following text:

```
 Throws:
    IllegalStateException - a transaction is neither active nor marked for rollback
```

be a satisfactory resolution to the ambiguity?
 

I take it therefore your "active (modulo ROLLBACK_ONLY)" means something like "known but not yet prepared" (which permits, by my reading, only Status.STATUS_ACTIVE and Status.STATUS_MARKED_ROLLBACK)?

Is there some better word for this category of statuses?  I guess not, and "active" means potentially either of them?  And then if you really care you have to check the transaction status code which might be, uh, "truly active" (Status.STATUS_ACTIVE) or "active in the sense of not yet being prepared but also not truly active" (Status.STATUS_MARKED_ROLLBACK)?

(A periodic thanks for everyone's time so far; I know discussions eat brain power!)

Best,
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