3.2.5.5.1 Receiving an XAUSER_XACT_MTAG_START Message

When the XA Subordinate Transaction Manager Facet receives an XAUSER_XACT_MTAG_START message, it MUST perform the following actions:

  • If the connection state is Idle:

    • Set the connection state to Processing Start Request.

    • Attempt to find the XA Superior Object in the XA Superior Table keyed by the guidXaRm field of the message.

    • If an Object is found:

      • Use this as the XA Superior Object in the remainder of the processing of this event.

    • Otherwise:

      • Attempt to create a new XA Superior Object with the following values:

        • Set the Open Count field to 1.

      • If the creation of the new XA Superior Object fails:

      • Otherwise:

        • Add the new XA Superior Object to the XA Superior Table referenced by the XA Subordinate Transaction Manager Facet with the guidXaRm field of the message as its key.

        • Use the created XA Superior Object as the XA Superior Object in the remainder of the processing of this event.

    • Attempt to find the XA Superior Enlistment Object in the XA Superior Enlistment Table referenced by the XA Superior Object that meets both of the following conditions:

      • The XID field is set to the value of the XAIdentifier field of the XA_UOW structure (section 2.2.1.4) contained within the XAUow field of the message.

      • The Coupling field is set to Tight.

    • If an Object is found:

    • Otherwise:

      • Attempt to find the XA Superior Enlistment Object in the XA Superior Enlistment Table referenced by the XA Superior Object that meets all of the following conditions:

        • The XA Global Transaction Identifier field of the XID field of the XA Superior Enlistment Object is set to the XA Global Transaction Identifier field of the value of the XAIdentifier field of the XA_UOW structure contained within the XAUow field of the message.

        • The Coupling field is set to Tight.

        • The State field set to Active or Migrate.

      • If an Object is not found:

        • Attempt to create a new XA Superior Enlistment Object with the following values:

          • The Coupling field is set to Tight.

          • The Resource Manager Recovery GUID is set to guidXaRm field of the message.

          • The XID field is set to the value of the XAIdentifier field of the XA_UOW structure contained within the XAUow field of the message.

          • The State field is set to Init.

          • The Current Request CMP Connection Object is set to receiving connection.

        • If failed:

          • Send an XAUSER_XACT_MTAG_START_NO_MEM message using the connection.

          • Set the connection state to Ended.

        • Otherwise:

          • Create a new GUID as specified in [RFC4122].

          • Attempt to create a new Transaction with the following settings:

            • The Isolation Level field is set to the isoLevel field of the message or 0.

            • The Timeout field is set to the Timeout field of the message or 0.

            • The Description field is set to the szDesc field of the message or "".

            • The Isolation Flags field is set to the isoFlags field of the message or 0.

            • The Transaction Object.Identifier field is set to the GUID created in the previous step.

          • If failed:

            • Send an XAUSER_XACT_MTAG_START_NO_MEM message using the connection.

            • Set the connection state to Ended.

          • Otherwise:

            • Set the Transaction field of the XA Superior Enlistment Object to the newly created Transaction.

            • Signal the Create Superior Enlistment event on the Core Transaction Manager Facet with the following argument:

              • The XA Superior Enlistment Object.

      • Otherwise:

        • If the XA Superior Enlistment Object has an XA Superior Child Branch Enlistment Object in Child Branch table with the XID field set to the value of the XAIdentifier field of the XA_UOW structure contained within the XAUow field of the message:

          • Send an XAUSER_XACT_MTAG_START_DUPLICATE message using the connection.

          • Set the connection state to Ended.

        • Otherwise:

          • Attempt to create a new XA Superior Child Branch Enlistment Object with the following values:

            • The XID field is set to the value of the XAIdentifier field of the XA_UOW structure contained within the XAUow field of the message.

            • The State field is set to Active.

            • The Parent XA Superior Enlistment Object set to found XA Superior Enlistment Object.

          • If failure:

            • Send an XAUSER_XACT_MTAG_START_NO_MEM message using the connection.

            • Set the connection state to Ended.

          • Otherwise:

            • Add the XA Superior Child Branch Enlistment Object to the XA Superior Enlistment Object 's Child Branch Table.

            • Set the State field of receiving connection to Active.

            • Set the XA Superior Child Branch Enlistment Object reference of the receiving connection to the new XA Superior Child Branch Enlistment.

            • Send an XAUSER_XACT_MTAG_STARTED message with the following arguments:

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