3.6.7.9 Create Resource Manager

The Create Resource Manager event MUST be signaled with the following arguments:

  • A resource manager object

If the Create Resource Manager event is signaled, the transaction manager communicating with a resource manager facet MUST perform the following actions:

  • Search for a resource manager object in the transaction manager's Active Resource Manager table with the same resource manager identifier as the provided resource manager object.

  • If such a resource manager object is found in the table:

    • If the connection object that is referenced by the found resource manager object is of type CONNTYPE_TXUSER_RESOURCEMANAGERINTERNAL (section 2.2.10.1.2):

      • If the connection state of the found resource manager object is either Reenlisting or Active:

        • Send a TXUSER_RESOURCEMANAGERINTERNAL_MTAG_DUPLICATEDETECTED (section 2.2.10.1.2.1) message using the connection object that is referenced by the found resource manager object.

      • Send a TXUSER_RESOURCEMANAGER_MTAG_DUPLICATE (section 2.2.10.1.1.2) message using the connection object that is referenced by the provided resource manager object. Set the state of the connection object that referenced the provided resource manager object to Ended.

      • Set the state of the connection object that referenced the provided resource manager object to Ended.

    • Otherwise,

      • Send a TXUSER_RESOURCEMANAGER_MTAG_DUPLICATE (section 2.2.10.1.1.2) message using the connection object that is referenced by the provided resource manager object.

      • Set the state of the connection object that referenced the provided resource manager object to Ended.

  • Otherwise

    • If the connection state is Creating:

      • Add the provided resource manager object to the Active Resource Manager table, using the resource manager identifier field as the key.

      • Send a TXUSER_RESOURCEMANAGER_MTAG_REQUEST_COMPLETE (section 2.2.10.1.1.4) message using the connection.

      • Set the connection state to Reenlisting.