3.4.5.3.1 Receiving an XATMUSER_MTAG_ENLIST Message

When the XA Resource Manager Bridge Facet receives a XATMUSER_MTAG_ENLIST message (section 2.2.3.4.9), it MUST perform the following actions:

  • If the State field of the receiving Connection is set to Idle:

    • Set the State of the receiving Connection to Processing Enlist Request.

    • Attempt to find an XA Resource Manager object in the XA Resource Manager Table that meets the following condition:

      • The Resource Manager Global Identifier field is set to guidRM field of the message.

    • If the condition is met:

      • If the State field of the XA Resource Manager object is set to Active:

        • Attempt to find an XA Subordinate Enlistment object in the XA Subordinate Enlistment Table referenced by the found XA Resource Manager object that meets the following condition:

          • The XA Global Transaction Identifier portion of the Data field of the XA_XID structure contained in the XID field of the XA Subordinate Enlistment object is set to the XA Global Transaction Identifier portion of the Data field of the XA_XID structure contained in the Xid field of the message.

        • If an object is found:

          • Send an XATMUSER_MTAG_E_ENLISTMENTDUPLICATE message (section 2.2.3.4.1) on the receiving Connection.

          • Set the State field of the receiving Connection to Ended.

        • Otherwise:

          • Attempt to create an XA Subordinate Enlistment object with the following values:

            • The State field is set to Idle.

            • The Transaction Manager Facet field is set to the XA Resource Manager Bridge Facet.

            • The resource manager Identifier field is set to guidRM field of the message.

            • The XID field is set to the Xid field of the message.

            • The Current Request Connection field is set to the receiving Connection.

          • If successful:

            • Add the newly created XA Subordinate Enlistment object to the XA Subordinate Enlistment Table referenced by the found XA Resource Manager object.

            • Acting as an Application Role as specified in [MS-DTCO] section 3.3 and signaling the event specified in [MS-DTCO] section 3.3.4.6, attempt to import a transaction using the following value:

              • The ImportCookie of the received message.

            • If successful:

              • Set the XA Subordinate Enlistment object referenced by the receiving connection to the created XA Subordinate Enlistment object.

              • Set the Transaction referenced by the created XA Subordinate Enlistment object to the Imported Transaction.

              • Signal the Create Subordinate Enlistment Success event (section 3.4.7.5) on the Core Transaction Manager Facet with the following argument:

                • The created XA Subordinate Enlistment object.

            • Otherwise:

              • Remove the created XA Subordinate Enlistment object from the XA Subordinate Enlistment Table referenced by the found XA Resource Manager object.

              • Send an XATMUSER_MTAG_E_ENLISTMENTIMPFAILED using the receiving connection.

              • Set the State of receiving connection to Ended.

          • Otherwise:

      • Otherwise, if the State field of the XA Resource Manager object is set to Ended:

      • Otherwise:

    • Otherwise:

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