Dedicated persistent sockets

A dedicated persistent socket is a socket connection that is assigned to a specific client ID and remains dedicated to that particular client ID until it is disconnected.

Typically, a dedicated persistent socket connection is used (or reused) serially by a single application. However, a dedicated persistent socket connection can also be used serially by multiple applications, which can obtain the socket by using the same client ID.

If different applications attempt to use a dedicated persistent socket connection by using the same client ID at the same time, the attempt by the first application will succeed. Subsequent attempts by other applications when the first application is still using its connection will receive duplicate client errors (DUPCLNT) from IMS Connect.

A duplicate client error might also occur when an application that obtains a dedicated persistent socket connection by using a given client ID runs in an environment in which dedicated persistent socket connections originate from multiple WebSphere® Application Server instances. For example, an environment that has multiple WebSphere Application Server instances that are managed by a workload manager might encounter duplicate client errors.
Recommendation: Do not deploy your application to this type of environment if it uses a dedicated persistent socket connection.
Dedicated persistent socket connections are intended to be used in an environment in which a single instance of WebSphere Application Server is connected to a single IMS Connect. In some situations, a single instance of WebSphere Application Server can be connected to multiple instances of IMS Connect. In this configuration, if Sysplex Distributor is used between WebSphere Application Server and IMS Connect, the following interactions are not supported:
  • Two-phase commit recovery
  • IMS conversational transactions

Supported commit mode and interactions

A dedicated persistent socket can be used only for Java™ applications that execute commit mode 0 interactions.

Table 1. Supported commit modes, interaction verbs, and sync levels by socket type
Commit mode Socket type Interaction verb Client ID Sync level
CM1 Shareable persistent
  • SYNC_END_CONVERSATION (for conversational transactions)
  • SYNC_SEND_RECEIVE
Automatically generated and managed None or Confirm
CM0 Shareable persistent
  • SYNC_SEND
  • SYNC_SEND_RECEIVE
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT
  • SYNC_RECEIVE_CALLOUT (for non-managed callout programming model)
Automatically generated and managed Confirm
Dedicated persistent
  • SYNC_SEND
  • SYNC_SEND_RECEIVE
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT
Specified by client applications (the clientID property) Confirm
Table 2. Supported commit modes, interaction verbs, and sync levels by socket type
Commit mode Socket type Interaction verb Client ID Sync level
CM1 Shareable persistent
  • SYNC_END_CONVERSATION (for conversational transactions)
  • SYNC_SEND_RECEIVE
Automatically generated and managed None or Confirm
CM0 Shareable persistent
  • SYNC_SEND
  • SYNC_SEND_RECEIVE
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT
  • SYNC_RECEIVE_CALLOUT (for non-managed callout programming model)
Automatically generated and managed Confirm
Dedicated persistent
  • SYNC_SEND
  • SYNC_SEND_RECEIVE
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT
  • SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT
Specified by client applications (the clientID property) Confirm

The SYNC_RECEIVE_ASYNCOUTPUT interaction verb is deprecated and replaced by the SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT interaction verb.

Message retrieval

SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT and SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT interactions (along with the deprecated SYNC_RECEIVE_ASYNCOUTPUT interaction) on dedicated persistent sockets enable client applications to retrieve messages from the following sources:
  • Messages that were placed on an IMS OTMA asynchronous output queue as a result of a failed commit mode 0 interaction
  • Messages that were from an IMS application that issued an insert to an Alternate Program Communication Block (ALTPCB)
  • Messages from the reroute of the output from a transaction that was executed on a shareable socket connection
To retrieve these messages, the client application must provide the client ID, which represents the tpipe that asynchronous output messages are queued. Undelivered output messages from interactions on dedicated persistent sockets cannot be rerouted or purged.

You might not be able to retrieve all available output messages with the SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT interactions when you use multiple IMS systems without the OTMA Super Member.

Dedicated persistent socket connections

Dedicated persistent socket connections are created by an IMS connection factory with values for at least the following custom properties:
  • Host name: TCP/IP host name of the system that is running IMS Connect
  • Port number: associated port number
  • Data store name: name of the target IMS
  • CM0 dedicated: true

A value of true for the CM0Dedicated property ensures that the connection factory creates dedicated persistent socket connections.

If more than one connection factory is configured to create dedicated persistent sockets to the same IMS Connect instance, only one connection factory can dedicate a socket to a particular client ID at one time. For example, assume that a connection factory successfully creates a socket connection that is dedicated to a client ID, CLIENT01. A second connection factory also tries to create a socket connection that is dedicated to CLIENT01. If the socket connection that is created by the first connection factory is still connected to IMS Connect, the second connection will receive the following exception:
javax.resource.spi.EISSystemException: ICO0001E:
com.ibm.connector2.ims.ico.IMSTCPIPManagedConnection@23766050.processOutputOTMAMsg
(byte [], InteractionSpec,Record) error. IMS Connect returned error: RETCODE=[8], 
REASONCODE=[DUPECLNT]. 
Duplicate client ID was used;  the client ID is currently in use.