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.
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!)