3.3.5.3.1 Receiving a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE Message
When the Transaction Manager Communicating with an LU 6.2 Implementation Facet receives a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE (section 2.2.3.3.1) message, it MUST perform the following actions:
If the connection state is Idle:
Set the connection state to Processing Enlistment Request.
Attempt to find the LU Pair object keyed by the value of the first cbLength bytes of the rgbBlob field of the DTCLU_VARLEN_BYTEARRAY structure (contained in the LuNamePair field) of the message in the LU Pair Table.
If the LU Pair object is not found:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_LU_NOT_FOUND (section 2.2.3.3.17) message using the connection.
Set the connection state to Ended (section 3.3.1.4.9).
Otherwise:
Set the LU Pair field of the connection object to the found LU Pair object.
If the LU Pair Recovery State field of the found LU Pair object is set to Recovery Process Not Attached:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_LU_NO_RECOVERY_PROCESS (section 2.2.3.3.20) message using the connection.
Set the connection state to Ended.
Otherwise, if the LU Pair Recovery State field of the found LU Pair object is set to Not Synchronized:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_LU_DOWN (section 2.2.3.3.21) message using the connection.
Set the connection state to Ended.
Otherwise, if the LU Pair Recovery State field of the found LU Pair object is set to either Synchronizing No Remote Name or Synchronizing Have Remote Name:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_LU_RECOVERING (section 2.2.3.3.22) message using the connection.
Set the connection state to Ended.
Otherwise, if the LU Pair Recovery State field of the found LU Pair object is set to Inconsistent:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_LU_RECOVERY_MISMATCH (section 2.2.3.3.23) message using the connection.
Set the connection state to Ended.
Otherwise:
Attempt to find the Transaction object keyed by the value of the guidTx field of the message in the Transaction table of the Core Transaction Manager Facet.
If the Transaction object is not found:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_TX_NOT_FOUND (section 2.2.3.3.13) message using the connection.
Set the connection state to Ended.
Otherwise:
Attempt to find an LUW object with its LUW Identifier field set to the value of the first cbLength bytes of the rgbBlob field of the DTCLU_VARLEN_BYTEARRAY structure (contained in the LuTransId field) of the message in the LUW List of the found LU Pair object.
If an LUW object is found:
Send a TXUSER_DTCLURMENLISTMENT_MTAG_CREATE_DUPLICATE_LU_TRANSID (section 2.2.3.3.19) message using the connection.
Set the connection state to Ended.
Otherwise:
Create a new Enlistment object that is initialized as follows:
Set the Transaction Manager Facet field to the Transaction Manager Communicating with an LU 6.2 Implementation Facet.
Set the Transaction field to the found Transaction object.
Set the Resource Manager Identifier field to the resource manager identifier field of the found LU Pair object.
Set the Connection field to the connection object.
Create a new LUW object that is initialized as follows:
Set the Transaction Identifier field to the guidTx field of the message.
Set the LUW Identifier field to the first cbLength bytes of the rgbBlob field of the DTCLU_VARLEN_BYTEARRAY structure (contained in the LuTransId field) of the message.
Set the Enlistment field to the new Enlistment object.
Set the Recovery Sequence Number For LUW field to the Recovery Sequence Number field of the found LU Pair object.
Set the Local LU LUW State field to Active.
Set the LUW Recovery State field to Recovery Not Needed.
Set the Is Conversation Lost Flag to FALSE.
Set the LUW field on the connection to refer to the new LUW object.
Add the new LUW object to the LUW List of the found LU Pair Object.
Signal the Create Subordinate Enlistment event (as specified in [MS-DTCO] section 3.2.7.11) on the Core Transaction Manager Facet with the following argument:
The new Enlistment object.
Otherwise, if the connection state is Ended:
Ignore the message.
Otherwise, the message MUST be processed as an invalid message, as specified in [MS-DTCO], section 3.1.6.