2.3 Transaction Completion and Recovery
TMs and RMs use two-phase commit with presumed rollback, as defined by the
referenced OSI DTP specification (model).
In Phase 1, the TM asks all RMs to prepare to commit (or prepare) transaction branches.
This asks whether the RM can guarantee its ability to commit the transaction branch.
An RM may have to query other entities internal to that RM.
If an RM can commit its work, it records stably the information it needs to do so, then
replies affirmatively. A negative reply reports failure for any reason. After making a
negative reply and rolling back its work, the RM can discard any knowledge it has of
the transaction branch.
In Phase 2, the TM issues all RMs an actual request to commit or roll back the
transaction branch, as the case may be. (Before issuing requests to commit, the TM
stably records the fact that it decided to commit, as well as a list of all involved RMs.)
All RMs commit or roll back changes to shared resources and then return status to the
TM. The TM can then discard its knowledge of the global transaction.
2.3.1 Rolling Back the Global Transaction
The TM rolls back the global transaction if any RM responds negatively to the Phase 1
request, or if the AP directs the TM to roll back the global transaction. Therefore, any
negative response vetoes the global transaction. A negative response concludes an
RM’s involvement in the global transaction.
The TM effects Phase 2 by telling all RMs to roll back transaction branches. They must
not let any changes to shared resources become permanent. The TM does not issue
Phase 2 requests to RMs that responded negatively in Phase 1. The TM does not need
to record stably the decision to roll back nor the participants in a rolled back global