1.3.1.2 Phase One

When Phase One begins, all transaction participants are now presumed to have completed their work inside the transaction.

During Phase One, each Phase One participant is asked to vote on the outcome of the transaction. Each participant vote can have one of three possible results:

  • Read Only: The participant agrees for the transaction to Commit but does not require an outcome notification.

  • Prepared: The participant agrees for the transaction to Commit and requires an outcome notification.

  • Aborted: The participant requires that the transaction abort.

Before a participant can vote Prepared, it performs whatever actions are necessary to be able to process an order to Commit or an order to Abort at some point in the future. Note that the request for a vote polls the transaction tree from the root transaction manager down to the leaf participants. When a subordinate transaction manager receives a request for a vote, it will first issue that request to all its immediate subordinates and process their votes before voting itself.

When all votes are collected by the root transaction manager, a decision about the transaction outcome is made. If every vote was either Read Only or Prepared, the root transaction manager attempts to record a Commit outcome decision. If successful, the Commit outcome decision is officially made.

Otherwise, if one or more of the votes is Aborted or if a Commit outcome decision cannot be successfully recorded, the transaction manager makes an Abort outcome decision.

After an outcome decision is made, the root transaction manager proceeds to Phase Two to distribute outcome notification messages throughout the transaction tree.

The following figure depicts the Phase One flow.

Transaction manager Phase One flow

Figure 3: Transaction manager Phase One flow