3.6.5.2.2.2 Receiving a TXUSER_ENLISTMENT_MTAG_PREPAREREQDONE Message

When the transaction manager receives a TXUSER_ENLISTMENT_MTAG_PREPAREREQDONE (section 2.2.10.2.2.12) message, the transaction manager MUST perform the following actions:

  • If the connection state is Awaiting Prepare Response Aborted:

    • If the prepareReqDone field of the message is TXUSER_ENLISTMENT_PREPAREREQDONE_OK:

      • Send a TXUSER_ENLISTMENT_MTAG_ABORTREQ (section 2.2.10.2.2.1) message using the connection.

      • Set the connection state to Awaiting Abort Response.

    • Otherwise, set the connection state to Ended.

  • If the connection state is Awaiting Single Phase Commit Response:

    • Signal the Enlistment Phase One Complete (section 3.2.7.16) event on the Core Transaction Manager Facet (section 1.3.3.3.1) with the following arguments:

      • The Enlistment object of the connection.

      • The Phase One outcome set to:

        • Committed if the prepareReqDone field from the message is TXUSER_ENLISTMENT_PREPAREREQDONE_SINGLEPHASE_COMMIT.

        • Aborted if the prepareReqDone field from the message is TXUSER_ENLISTMENT_PREPAREREQDONE_ABORT.

        • Read Only if the prepareReqDone field from the message is TXUSER_ENLISTMENT_PREPAREREQDONE_READONLY.

        • Prepared if the prepareReqDone field from the message is TXUSER_ENLISTMENT_PREPAREREQDONE_OK.

      •  If the prepareReqDone field from the message is set to TXUSER_ENLISTMENT_PREPAREREQDONE_OK:

        • Set the connection state to Prepared.

      • Otherwise:

        • Set the connection state to Ended.

  • If the connection state is Awaiting Prepare Response:

    • Signal the Enlistment Phase One Complete (section 3.2.7.16) event on the Core Transaction Manager Facet with the following arguments:

      • The Enlistment object of the connection.

      • The Phase One outcome set to:

        • Aborted if the prepareReqDone field is TXUSER_ENLISTMENT_PREPAREREQDONE_ABORT.

        • Read Only if the prepareReqDone field is TXUSER_ENLISTMENT_PREPAREREQDONE_READONLY.

        •  Prepared if the prepareReqDone field is TXUSER_ENLISTMENT_PREPAREREQDONE_OK.

    • If the prepareReqDone field from the message is set to TXUSER_ENLISTMENT_PREPAREREQDONE_OK:

      • Set the connection state to Prepared.

    • Otherwise:

      • Set the connection state to Ended.

  •  If the connection state is Awaiting Abort Response:

    • Ignore the message.

  • Otherwise, the message MUST be processed as an invalid message as specified in section 3.1.6.