1.3.1.3 Phase Two
When Phase Two begins, the root transaction manager has determined the transaction outcome.
If the transaction outcome is a Commit outcome, the transaction enters the committing state. Each participant that voted Prepared is sent an order to commit. The participants perform any necessary commit processing and respond with a committed notification.
If the transaction outcome is an Abort outcome, the transaction enters the Aborting state. Each participant that voted Prepared is sent an order to abort. The participants perform any necessary abort processing and respond with an Aborted notification.
If a Prepared participant loses contact with its transaction manager, it is said to be In Doubt. If it is a durable resource manager, it attempts to reconnect to the transaction manager and perform recovery to learn the outcome of the transaction. See section 1.3.4 for recovery details.
In general, participants (including the root application) are sent the outcome decision notification in parallel.
Phase Two is complete when the root transaction manager sends the outcome decision notification to all the subordinate participants, the root transaction manager receives the reply notifications from all the subordinate participants, and the root transaction manager does the necessary work to forget the transaction.
The following figure shows the Phase Two flow.
Figure 4: Transaction manager Phase Two flow