Setting socket types for IMS TM clients

For IMS Connect clients that access IMS TM, client code controls the socket settings, and the IMS Connect user message exits and the user initialization exit enforce the socket settings.

The client selects the socket connection type by setting a flag in the IMS request message (IRM) header, in the field IRM_SOCT. The IRM_SOCT flag values are shown in the following table.
Table 1. IRM_SOCT flags
Flag Definition Socket type
IRM_SOCT_PER X'10' Persistent
IRM_TRAN X'00' Transaction
IRM_SOCT_NONPER X'40' Non-persistent

The IRM_SOCT flag must be set for each message that is sent to IMS Connect from an IMS Connect client that accesses IMS TM.

Recommendation: Set all messages that are associated with a single transaction to the same socket type. If you do not, unexpected results can occur, as described in the following examples:
  • If the first message of a conversational transaction is set to persistent, and the last message is set to transaction, then the socket connection will be terminated following the last message.
  • If one of the messages in the middle of the conversational transaction set the socket type to transaction, and the IMS transaction terminates for some reason, then IMS Connect will disconnect the socket. This is because "transaction" was the last known socket type.
The user message exits determine the socket type, then move the socket type information to the user data section of the OTMA message header that they return to IMS Connect. To transfer the socket type information to the OTMA message header, the user exits set the OMUSR_FLAG1 field, which is mapped by the HWSOMUSR DSECT of the HWSOMPFX macro, with one of the following flags as shown in the following table:
Table 2. OMUSR_FLAG1 flags
Flag Definition Socket type
OMUSR_PSOCKET X'10' Persistent
OMUSR_TRAN X'00' Transaction
OMUSR_NPSOCKET X'40' Non-persistent