3.6.3 Two-Phase Commit Transactional Message Exchange
The following diagram shows two-phase commit protocol message exchange in a distributed transaction.

Figure 19: Two-phase commit protocol message exchange in a distributed transaction
The following steps describe this sequence:
Commit [C6.3]: The application sends a TXUSER_BEGIN2_MTAG_COMMIT message to the root transaction manager over its existing CONNTYPE_TXUSER_BEGIN2 connection, as specified in [MS-DTCO] section 4.5.1. The application maintains the connection and waits for the outcome of the transaction to the root transaction manager.
PrepareReq (2PC) [C7.3]: The root transaction manager sends a TXUSER_ENLISTMENT_MTAG_PREPAREREQ message to the resource manager over the CONNTYPE_TXUSER_ENLISTMENT connection, indicating that this is a two-phase commit (2PC), as specified in [MS-DTCO] section 4.5.1.1.
Prepare [T1.4]: The root transaction manager sends a PREPARE command over the Transaction Internet Protocol (TIP) connection associated with the transaction to the remote transaction manager, as specified in [MS-TIPP] section 4.1.3.1.1.
PrepareReqDoneOK [C7.4]: When the resource manager has successfully completed its Phase One work, it sends a TXUSER_ENLISTMENT_MTAG_PREPAREREQDONE message to the root transaction manager indicating TXUSER_ENLISTMENT_PREPAREREQDONE_OK, as specified in [MS-DTCO] section 4.5.1.1. The resource manager maintains the connection and waits for the transaction outcome from the root transaction manager.
Prepared [T1.5]: When the remote transaction manager has successfully completed its Phase One processing, it sends a PREPARED command to the root transaction manager over the TIP connection, as specified in [MS-TIPP] section 4.1.3.1.2. The state of the TIP connection is now PREPARED, and the remote transaction manager waits for the transaction outcome from the root transaction manager.
PrepareReq (2PC) [C10.3]: The root transaction manager sends a PARTNERTM_PROPAGATE_MTAG_PREPAREREQ message to the external transaction manager over the CONNTYPE_PARTNERTM_BRANCH connection, indicating that this is a two-phase commit (2PC), as specified in [MS-DTCO] section 4.5.1.2.
ToLuPrepare [C11.3]: The external transaction manager iterates through each of its subordinate branches to send out Phase One notifications and sends a TXUSER_DTCLURMENLISTMENT_MTAG_TO_LU_PREPARE message to the external resource manager over the CONNTYPE_TXUSER_DTCLURMENLISTMENT connection, as specified in [MS-DTCLU] section 4.4.2.
ToDtcRequestCommit [C11.4]: The external resource manager completes its Phase One work, sends a TXUSER_DTCLURMENLISTMENT_MTAG_TO_DTC_REQUESTCOMMIT message to the external transaction manager, and waits for the transaction outcome from the external transaction manager, as specified in [MS-DTCO] section 4.4.2.
PrepareReqDoneOK [C10.4]: The external transaction manager sends a PARTNERTM_PROPAGATE_MTAG_PREPAREREQDONE message to the root transaction manager, as specified in [MS-DTCLU] section 4.5.1.2. The external transaction manager maintains the connection and waits for the transaction outcome from the root transaction manager.
Stats [C1.7]: Because the transaction's outcome is not yet known, the root transaction manager sends a MSG_DTCUIC_STATS message to the management tool with no changes from its previous message [T1.5] related to this transaction, as specified in [MS-CMOM] section 3.2.1.1.
TranList (guidTx:Preparing) [C1.8]: The root transaction manager sends a MSG_DTCUIC_TRANLIST message to the management tool, listing the transaction (guidTx) in the preparing state (XACTSACT_PREPARING), as specified in [MS-CMOM] section 3.2.1.1.
SinkError(Committed) [C6.4]: The root transaction manager sends a TXUSER_BEGIN2_MTAG_SINK_ERROR message to the application over the CONNTYPE_TXUSER_BEGIN2 connection, specifying that the transaction has been committed (TRUN_TXBEGIN_ERROR_NOTIFY_COMMITTED), as specified in [MS-DTCO] section 4.5.1.3. When the application receives the TXUSER_BEGIN2_MTAG_SINK_ERROR message, it initiates the disconnect sequence.
Commit [T1.6]: The root transaction manager sends a COMMIT command over the TIP connection associated with the transaction to the remote transaction manager, as specified in [MS-TIPP] section 4.1.3.1.4.
CommitReq [C7.5]: The root transaction manager sends a TXUSER_ENLISTMENT_MTAG_COMMITREQ message to the resource manager over the CONNTYPE_TXUSER_ENLISTMENT connection, as specified in [MS-DTCO] section 4.5.2.1.
CommitReqDone [C7.6]: When the resource manager has completed its commit work, it sends a TXUSER_ENLISTMENT_MTAG_COMMITREQDONE message to the root transaction manager and initiates the disconnect sequence on the CONNTYPE_TXUSER_ENLISTMENT connection with the root transaction manager, as specified in [MS-DTCO] section 4.5.2.1.
Committed [T1.7]: When the remote transaction manager has successfully completed its Phase Two processing, it sends a COMMITTED command to the root transaction manager over the TIP connection, as specified in [MS-TIPP] section 4.1.3.1.4.
CommitReq [C10.5]: The root transaction manager sends a PARTNERTM_PROPAGATE_MTAG_COMMITREQ message to the remote transaction manager over the CONNTYPE_PARTNERTM_BRANCH connection, as specified in [MS-DTCO] section 4.5.2.2.
ToLuCommitted [C11.5]: When the external transaction manager receives the PARTNERTM_PROPAGATE_MTAG_COMMITREQ message, it iterates through each of its subordinate branches to send out commit notifications and sends a TXUSER_DTCLURMENLISTMENT_MTAG_TO_LU_COMMITTED message to the external resource manager over the CONNTYPE_TXUSER_DTCLURMENLISTMENT connection, as specified in [MS-DTCLU] section 4.4.2.
ToDtcForget [C11.6]: When the external resource manager receives the TXUSER_DTCLURMENLISTMENT_MTAG_TO_LU_COMMITTED message, it completes its Phase-Two processing, sends a TXUSER_DTCLURMENLISTMENT_MTAG_TO_DTC_FORGET message to the external transaction manager, and initiates the disconnect sequence, as specified in [MS-DTCLU] section 4.4.2.
CommitReqDone [C10.6]: When the external transaction manager receives the TXUSER_DTCLURMENLISTMENT_MTAG_TO_DTC_FORGET message, it sends a PARTNERTM_PROPAGATE_MTAG_COMMITREQDONE user message to the root transaction manager and initiates the disconnect sequence, as specified in [MS-DTCO] section 4.5.2.2.
Stats(open--,committed++) [C1.9]: Because the transaction is now committed, the root transaction manager sends a MSG_DTCUIC_STATS message to the management tool, as specified in [MS-CMOM] section 3.2.1.1, with the number of open transactions decremented by one (open--) and the number of committed transactions incremented by one (committed++).
TranList(guidTx:NotifyingCommitted) [C1.10]: The root transaction manager sends a MSG_DTCUIC_TRANLIST message to the management tool, as specified in [MS-CMOM] section 3.2.1.1, listing the transaction (guidTx) in the notifying committed state (XACTSACT_NOTIFYING_COMMITTED).
Stats [C1.11]: The root transaction manager sends an MSG_DTCUIC_STATS message to the management tool, as specified in [MS-CMOM] section 3.2.1.1, with no changes from its previous message [C1.9] related to this transaction.
TranList(guidTx:Forget) [C1.12]: The root transaction manager sends an MSG_DTCUIC_TRANLIST message to the management tool, as specified in [MS-CMOM] section 3.2.1.1, listing the transaction (guidTx) in the forget state (XACTSACT_FORGET). Any future MSG_DTCUIC_TRANLIST messages do not include this transaction.
Stats [C1.13]: The root transaction manager sends an MSG_DTCUIC_STATS message to the management tool, as specified in [MS-CMOM] section 3.2.1.1, with no changes from its previous message [C1.11] related to this transaction. Because there are no active transactions that the root transaction manager is tracking, no MSG_DTCUIC_TRANLIST message is sent.
Note The sequence of the messages in this example might not always be the same. It can vary slightly.