3.3 Example 3: Abort a Transaction

This example demonstrates how a transaction is aborted as described in use case Complete a Transaction – Application (section 2.5.2). A transaction is aborted if at least one of the subordinate participants that is involved in the transaction is prepared to abort the changes.

The diagram of the transaction tree for this example is shown in Example 1, as described in section 3.1.

Prerequisites:

  • Transaction processing services protocols meet all the preconditions, as described in section 2.4.

  • Transaction processing services are operational.

  • The application can access a transaction manager in the system.

  • Transaction work is performed.

Initial System State

A transaction is performed by an application.

Final System State

The two-phase commit sequence is completed, and the transaction is aborted.

Sequence of Events

The messages that are exchanged in this example are contained within the two-phase commit notifications action between the system and participating roles.

Example of aborting a transaction

Figure 14: Example of aborting a transaction

The following steps describe this sequence:

  1. The root transaction manager sends a TXUSER_ENLISTMENT_MTAG_PREPAREREQ message to the resource manager over the CONNTYPE_TXUSER_ENLISTMENT connection, as specified in [MS-DTCO] section 4.5.1.1, indicating that this is a two-phase commit.

  2. The root transaction manager sends a PARTNERTM_PROPAGATE_MTAG_PREPAREREQ message to the remote transaction manager over the CONNTYPE_PARTNERTM_BRANCH connection, as specified in [MS-DTCO] section 4.5.1.2, indicating that this is a two-phase commit.

  3. The resource manager sends a TXUSER_ENLISTMENT_MTAG_PREPAREREQDONE message to the root transaction manager indicating that the prepare request was finished successfully (OK) (TXUSER_ENLISTMENT_PREPAREREQDONE_OK, as specified in [MS-DTCO] section 4.5.1.1), completing step 1.

  4. The remote transaction manager sends a TXUSER_ENLISTMENT_MTAG_PREPAREREQ message to the remote resource manager over the CONNTYPE_TXUSER_ENLISTMENT connection, as specified in [MS-DTCO] section 4.5.1.1, indicating that this is a two-phase commit.

  5. The remote resource manager sends a TXUSER_ENLISTMENT_MTAG_PREPAREREQDONE message to the remote transaction manager indicating that the prepare request was finished unsuccessfully (Abort) (TXUSER_ENLISTMENT_PREPAREREQDONE_ABORT, as specified in [MS-DTCO] section 4.5.1.1), completing step 4.

  6. The remote transaction manager sends a PARTNERTM_PROPAGATE_MTAG_PREPAREREQDONE message to the root transaction manager indicating that the prepare request was unsuccessful (Abort), as specified in [MS-DTCO] section 4.5.1.2, completing step 2.

  7. The root transaction manager sends a TXUSER_BEGIN2_MTAG_SINK_ERROR message to the application over the CONNTYPE_TXUSER_BEGIN2 connection, as specified in [MS-DTCO] section 4.1.2.1, indicating that the transaction has committed (TRUN_TXBEGIN_ERROR_NOTIFY_ABORTED), completing step 21 in Example 1: Perform Transaction Work (section 3.1).

  8. The root transaction manager sends a TXUSER_ENLISTMENT_MTAG_ABORTREQ message to the resource manager over the CONNTYPE_TXUSER_ENLISTMENT connection, as specified in [MS-DTCO] section 2.2.10.2.2.1.

  9. The resource manager sends a TXUSER_ENLISTMENT_MTAG_ABORTREQDONE message to the root transaction manager, completing step 8, as specified in [MS-DTCO] section 2.2.10.2.2.2.