3.3.5.3.1 Receiving an XAUSER_XACT_MTAG_OPENED Message
When the XA Superior Transaction Manager receives an XAUSER_XACT_MTAG_OPENED message, it MUST perform the following actions:
If the State field of the receiving XA Transaction CMP Connection is set to Awaiting Open Response:
Set the Transaction Identifier field of the XA Transaction Object referenced by receiving connection to the guidTx field of the message.
Set the receiving connection state to Processing Opened Response.
Set the State field of the XA Transaction Object referenced by receiving connection to Active.
Add the XA Transaction Object referenced by receiving connection to the XA Transaction Table referenced by the Parent XA Superior Proxy referenced by the XA Transaction Object.
If the Action field of the receiving Connection is set to Prepare:
Set the State field of the receiving connection to Awaiting Prepare Response.
Set the State field of XA Transaction Object referenced by receiving connection to Preparing.
Send an XAUSER_XACT_MTAG_PREPARE message with the following values:
The fSinglePhase field set to 0x00000000.
Otherwise if the Action field of the receiving Connection is set to Prepare Single Phase:
Set the State field of the receiving connection to Awaiting Prepare Response.
Set the State field of the XA Transaction Object referenced by receiving connection to Preparing.
Send an XAUSER_XACT_MTAG_PREPARE message with the following values:
The fSinglePhase field set to 0x00000001.
Otherwise if the Action field of the receiving Connection is set to Commit:
Set the State of the receiving connection to Awaiting Commit Response.
Set the State field of the XA Transaction Object referenced by receiving connection to Committing.
Send an XAUSER_XACT_MTAG_COMMIT message.
Otherwise if the Action field of the receiving Connection is set to Rollback:
Set the State field of the receiving connection to Awaiting Abort Response.
Set the State field of the XA Transaction Object referenced by receiving connection to Aborting.
Send an XAUSER_XACT_MTAG_ABORT message.
Otherwise:
Signal the Disconnect Connection event using the receiving connection as the argument.