3.4.5.2.1.1.1 Receiving a TXUSER_ASSOCIATE_MTAG_ASSOCIATE Message
When the transaction manager communicating with an application facet receives a TXUSER_ASSOCIATE_MTAG_ASSOCIATE message, it MUST perform the following actions:
If the connection state is Idle:
Set the connection state to Processing Associate Request (section 3.4.1.4.2).
Override the default schema verification actions for incoming messages as specified in section 3.1.6 in the following manner:
If the first 16 bytes of the SourceTmAddr field is equal to the binary representation of the GUID {DC85CB48-D8A5-11d2-828B-00805F0DF75A}, then:
If the SourceTmAddr field does not conform to the constraints specified in section 2.2.4.2 for a valid OLETX_TM_ADDR structure, then:
Send a TXUSER_ASSOCIATE_MTAG_CREATE_BAD_TMADDR message by using the connection.
Perform default invalid message processing, as specified in section 3.1.6.
Stop processing the message.
Otherwise, if the SourceTmAddr field does not conform to the constraints specified in section 2.2.5.3 for a valid NAMEOBJECTBLOB structure, then:
Send a TXUSER_ASSOCIATE_MTAG_CREATE_BAD_TMADDR message by using the connection.
Perform default invalid message processing, as specified in section 3.1.6.
Stop processing the message.
If the Allow Network Access flag, the Allow Network Transactions flag, or the Allow Inbound Transactions flag of the core transaction manager is set to false:
Send a TXUSER_ASSOCIATE_MTAG_CREATE_BAD_TMADDR message using the connection.
Set the connection state to Ended.
Otherwise, if the transaction manager does not have sufficient memory available to process the message:
Send a TXUSER_ASSOCIATE_MTAG_NO_MEM_LOCAL message.
Set the connection state to Ended.
Otherwise:
Find the transaction object in the transaction table of the transaction manager using the guidTx field from the message as the key:
If the transaction object is found in the list:
Send a TXUSER_ASSOCIATE_MTAG_ASSOCIATED message to the application.
Set the connection state to Active.
Otherwise, if the transaction object is not found in the list, the transaction manager MUST:
Find the list of CONNTYPE_TXUSER_ASSOCIATE connections in the Associates Table field of the transaction manager communicating with an application, using the guidTx field from the message as a key.
If the list is found:
Add this connection to the list.
Otherwise:
Create an empty list of CONNTYPE_TXUSER_ASSOCIATE connections and add this connection to it.
Add the list to the associates table of the transaction manager communicating with an application under the following key:
The guidTx field from the message.
Create a new transaction object with the information provided in the message:
Use the guidTx field as the Transaction Object.Identifier value.
Use the isoLevel field as the Isolation Level value.
Use the szDesc field as the Description value.
If the SourceTmAddr field contains OLETX_TM_ADDR (section 2.2.4.2), convert the SourceTmAddr field from the message to a new Name object, as specified in section 3.1.1.2.
Otherwise, convert the SourceTmAddr field from the message to a new Name object, as specified in Converting a NAMEOBJECTBLOB Structure to a Name Object (section 3.1.1.4).
Signal the Associate Transaction (section 3.2.7.1) event on the Core Transaction Manager Facet with the following arguments:
The transaction object.
The new Name object.
Otherwise, the message MUST be processed as an invalid message as specified in section 3.1.6.