3.3.4.4 Creating an Export Connection

If the higher-layer business logic initiates a push propagation by using a specified SWhereabouts structure, the application MUST perform the following actions:

  • If the transaction manager of the application supports the CONNTYPE_TXUSER_EXPORT2 connection type as specified in section 2.2.1.1.1:

    • Initiate a new CONNTYPE_TXUSER_EXPORT2 (section 2.2.8.2.2.3) connection by using the Transaction Manager Name field of the application.

  • Otherwise:

    • Initiate a new CONNTYPE_TXUSER_EXPORT (section 2.2.8.2.2.2) connection by using the Transaction Manager Name field of the application.

  • Add the connection to the transaction connection list.

  • If the negotiated protocol version of the previously initiated CONNTYPE_TXUSER_EXPORT connection supports the TXUSER_EXPORT_MTAG_CREATE2 (section 2.2.8.2.2.2.2) MTAG, as specified in 2.2.1.1.1:

    • Send a TXUSER_EXPORT_MTAG_CREATE2 message by using the connection.

  • Otherwise:

    • Send a TXUSER_EXPORT_MTAG_CREATE (section 2.2.8.2.2.2.1) message using the connection:

  • The SourceTmAddr field of the message MUST be set either to an OLETX_TM_ADDR (section 2.2.4.2) structure or a NAMEOBJECTBLOB (section 2.2.5.3) structure, as specified in section 2.2.1.1.1.

    • Find the STmToTmProtocol entries in the SWhereabouts structure corresponding to TmProtocolMsdtcV1 and TmProtocolMsdtcV2. See section 2.2.5.11 for more details.

    • If the SourceTmAddr field is an OLETX_TM_ADDR structure, the fields of the OLETX_TM_ADDR structure MUST be set as follows:

      • The guidSignature field MUST be set as specified in section 2.2.4.2.

      • The guidEndpoint field MUST be set to the guidEndpointID field of the SDtcCmEndpointInfoV1 structure.

      • The grbComProtsSupported field MUST be set to the comprotSupported field of the SDtcCmEndpointInfoV1 structure.

      • If a TmProtocolMsdtcV2 entry was found:

      • Otherwise:

        • The wszHostName field MUST be set to the szHostName field of the SDtcCmEndpointInfoV1 structure and converted to Unicode little-endian UTF-16 encoding. This field MUST NOT contain a Unicode byte order mark (BOM) character.

    • Otherwise, if the SourceTmAddr field is a NAMEOBJECTBLOB structure, the fields of the NAMEOBJECTBLOB structure MUST be set as follows:

      • The szGuid field MUST be set to the guidEndpointID field of the SDtcCmEndpointInfoV1 structure and formatted as a string, as specified in [C706] appendix A.

      • The grbComProtsSupported field MUST be set to the comprotSupported field of the SDtcCmEndpointInfoV1 structure.

      • The szHostName field MUST be set to the szHostName field of the SDtcCmEndpointInfoV1 structure.

      • The dwcbHostName and dwReserved1 fields MUST be set as specified in section 2.2.5.3.

  • Set the connection state to Awaiting Create Response.