Resolving duplicate client IDs

If a failure occurs between IMS Connect and the IMS Connect client, either because the connection failed or the client terminated unexpectedly, and IMS Connect does not detect the failure before the client attempts to reconnect with the same client ID, IMS Connect prevents the client from reconnecting because the client ID is a duplicate of the ID associated with the original failed connection.

To resolve duplicate client ID conditions after a failure you can have the incoming connection cancel the original client ID or you can cancel the IMS Connect message timer for the socket connection that the client was originally connected to. Canceling the client ID is the easier of these two options.

To decrease the chances of a duplicate client ID condition occurring in the first place, you can specify a small KeepAlive interval for all the socket connections on a given port. Specifying a small KeepAlive value helps IMS Connect detect and clean up failed client connections earlier, potentially before the client attempts to reconnect; however, a small KeepAlive value can also increase network traffic.

IMS TM Resource Adapter clients can also have IMS Connect generate unique client IDs for incoming connections, thereby avoiding the possibility that an incoming connection from IMS TM Resource Adapter might specify an ID that is a duplicate of an ID that is being used by an existing connection.

Canceling connections that have duplicate client IDs

When an incoming connection to IMS Connect specifies a client ID that is a duplicate of a client ID used by another existing connection, you can cancel the existing connection so that IMS Connect accepts the new connection. When a client ID is canceled, IMS Connect discards the existing connection, regardless of its state, and issues message HWSS0743I DUPLICATE CLIENT ID TERMINATED.

Canceling a connection with a duplicate client ID is supported for clients that use either persistent sockets or transactions sockets with either commit-then-send (CM0) or send-then-commit (CM1) transactions.

If a duplicate client ID is canceled, the previous session, if one exists, is cleaned up and the new request is completed. Then, if the socket type is a persistent socket, the session is maintained and if the socket is a transaction socket, the session is terminated.

For user-written IMS Connect client applications, you can cancel duplicate client ID connections in the following ways:

  • By coding the IMS Connect client application to specify X'80' (IRM_F3_CANCID) in the IRM_F3 field of the user section of the IRM message header mapped by the HWSIMSCB macro when the client establishes a new connection with IMS Connect.
  • By coding any of the following exit routines to specify X'20' (OMUSR_CANCID) in the OMUSR_FLAG1 field of the user data section of the OTMA message header mapped by the HWSOMPFX macro.

If IMS Connect has already detected the error and terminated the original connection, IMS Connect ignores any specification to cancel a duplicate client ID.

Canceling the message timer to resolve a duplicate client ID

You can resolve a duplicate client ID condition by canceling the IRM timer on the original failed client connection; however, the steps required to cancel a timer, which include issuing ACKs, SENDs, and READS, and connecting and disconnecting, make canceling the duplicate client ID the recommended method for resolving duplicate client ID conditions.

Auto-generated IDs for IMS TM Resource Adapter

For users of the IMS TM Resource Adapter, IMS Connect can generate a unique user ID if the user ID provided by IMS TM Resource Adapter on a new connection request is a duplicate of a user ID already in use by an existing connection.

After IMS Connect generates a user ID, the generated ID is used in all replies returned to IMS TM Resource Adapter.

When an IMS TM Resource Adapter client requests that IMS Connect generate a user ID, the OMUSR_FLAG2 field is set to X'40' (OMUSR_F2_CIDREQ) in the OTMA message prefix. When IMS Connect returns a reply that includes a generated user ID, OMUSR_FLAG2 is set to X'20' (OMUSR_F2_CIDGEN).