Resource coordination

IMS, as recovery coordinator, directs commit processing for updates to external subsystem resources initiated by IMS application programs. IMS uses a two-phase commit process to synchronize resources across external subsystems. External subsystems are participants in the process.

In the first phase of the commit process for an application, IMS polls the participants for a vote as to whether or not they are prepared to commit the updates. In the second phase, IMS directs the participants to commit or to abort. If all participants voted 'yes' on the first phase, IMS directs them to commit on the second phase; otherwise, IMS directs them to abort.

When an external subsystem determines that its resources are associated with non-update transactions (for which commit processing is not necessary), the external subsystem can perform all commit processing during the first phase, eliminating the need for the second phase. In this case, the external subsystem returns to IMS from the Commit Prepare exit routine with return code X'C' indicating that the first phase successfully completed and the second phase is not required. IMS will not initiate the second phase of commit processing for this external subsystem.

IMS uses a 16-byte recovery token to identify a unit of work across one or more subsystems. The recovery token for a unit of work is initially passed on the Signon exit routine invocation.

When application updates are to be committed, IMS activates the Commit Prepare exit routine supplied by the external subsystem. The associated recovery token is passed on the invocation. The external subsystem indicates, by the return code from the exit routine, whether or not it is prepared to perform commit processing for the recovery token. When an application is executing in a Distributed Syncopate environment (also known as a Protected Conversation environment) and requires a subsystem SIGNON, IMS obtains the XID token and places its address in the exit parameter list before calling the subsystem's SIGNON exit.

For the second phase of the commit process, if it is required, IMS can activate either of three external subsystem exit routines: the Commit Continue exit routine, the Abort Continue exit routine, or the Terminate Thread exit routine. When the application is not terminating and all participants are prepared to commit, IMS drives the Commit Continue exit routine. At completion of the commit process, the application will continue processing the current PSB on the existing thread. When the updates are to be aborted but the application is not terminating, or being terminated, the Abort Continue exit routine is activated. In this case, the application will continue processing under the same recovery token.

The external subsystem Terminate Thread exit routine must be able to process the second phase of commit. At application termination, IMS passes the recovery token and a commit option on the Terminate Thread exit routine invocation. The commit option indicates whether to commit or abort outstanding updates.

When IMS, the external subsystem, or an application program terminates abnormally, units of work that have not been committed or aborted are left outstanding. To resolve outstanding units of work, IMS activates the external subsystem Resolve Indoubt exit routine. IMS always activates the Resolve Indoubt exit routine at least once after establishing the control region connection. IMS activates the exit routine once for each outstanding recovery token indicating whether to commit or abort the unit of work. When there are no units of work to be resolved or when IMS has exhausted the list of outstanding recovery tokens, IMS activates the exit routine to inform the external subsystem of that fact. When IMS encounters an outstanding recovery token associated with z/OS® Resource Recovery Services, IMS will delay the subsystem Resolve Indoubt exit call until RRS or the IMS user has indicated (ABORT or COMMIT) which action to take. When called for RRS Resolve Indoubt, it is the subsystem's responsibility to ensure that recovery tokens are resolved in their proper order.

IMS maintains outstanding recovery tokens across normal (warm) and emergency restarts of IMS, and reconnections of the subsystems. IMS permits a connection without all recovery tokens being resolved (that is, the Resolve Indoubt exit routine return code can indicate that the recovery action was not taken). IMS destroys outstanding recovery tokens when it is cold started.

The Resolve Indoubt exit routine is also used to coordinate resources in the event of abnormal termination of an application program. Following an application program abend, the exit routine is activated from the control region if the application had a thread connection to the external subsystem.

You can also configure a Fast Database Recovery (FDBR) region to recover work on the external subsystem. When a FDBR region is monitoring an IMS system that fails, it receives information about indoubt work on the external subsystem from the ESAF Indoubt Notification exit routine (DFSFIDN0). Units of work associated with z/OS Resource Recovery Services are not recovered by FDBR.