Logical unit of work

A logical unit of work is any processing that occurs between sync points.

Within subsystems where the application directly controls the session, such as CICS®, the application sync point and the ISC session sync point occur simultaneously as the result of a single explicit or implicit application command. Within queued subsystems, such as IMS, the application processing and sync points are independent of those of the ISC session. IMS must map the application sync point to the ISC session sync-point request.

In the synchronous case (SEND/RECEIVE), CICS is the front-end subsystem. One logical unit of work includes all of the processing performed in both the IMS and CICS subsystems, from the point at which the CICS application last issued a sync point to the point at which the next sync point is issued, and a sync-point response is returned.

If the transaction is recoverable, only one message can be sent to IMS before the sync point must be requested by the CICS application. However, a series of nonrecoverable requests and replies can occur between a CICS sync-point request and an IMS response.

For recoverable messages, IMS returns this response only after the IMS application has inserted a response or conversational mode reply message and caused an application sync point. IMS then begins the next logical unit of work by sending the reply message requesting a sync point. The reply message satisfies the RECEIVE issued by the CICS transaction. The CICS transaction should complete all necessary processing prior to issuing a SYNCPOINT or RETURN (implicit sync point) command.

The application sync point causes CICS to return a sync-point response to IMS. IMS then completes the logical unit of work by dequeuing the reply message from the output message queue.

In the asynchronous case, where CICS is the front-end subsystem, for recoverable input to IMS, the input request and the returned reply message are separate logical units of work. When the CICS application issues a SEND LAST or START and requests a sync point, IMS returns the sync-point response as soon as the transaction is enqueued (made available for scheduling). IMS sends any recoverable asynchronous reply messages as they are made available by the transaction and requests a sync point on each. When the reply message is read by the CICS mirror transaction, an appropriate response is automatically returned to IMS. If the reply message is read using RECEIVE as a result of a previous SEND LAST, the sync point response is not returned to IMS until a subsequent SYNCPOINT, FREE, or RETURN command is issued.

One or more nonrecoverable transactions can be sent to IMS between CICS sync points using multiple START commands, each followed by a RETRIEVE. When the reply message is read by the CICS mirror transaction, an appropriate response is automatically returned to IMS.

The concept of logical unit of work (or work unit) is important in that session resynchronization must be performed when initiating a session and up to one work unit is considered to be indoubt on a flow from either the primary to the secondary half session or from the secondary to the primary. An indoubt work unit is one that is waiting to be committed or backed out based on the results of the session BIND and STSN flow.