Determine the disposition of "in doubt" units of work.
RESYNC ENTRYNAME >>-RESYNC ENTRYNAME(data-value)--+-----------------------+------> '-QUALIFIER(data-value)-' >--+--------------------------------------------------+---------> '-IDLIST(data-value)--+--------------------------+-' '-IDLISTLENGTH(data-value)-' >--+---------+------------------------------------------------->< '-PARTIAL-'
Conditions: NOTAUTH
The RESYNC command allows a non-CICS resource manager to determine whether units of work about which it is "in doubt" were committed or backed out.
A resource manager can be in doubt about a unit of work if it has been invoked for the first phase of syncpoint, but not for the second. A failure of either the resource manager or CICS between Phase 1 and Phase 2 leaves the resource manager in doubt about that unit of work.
CICS saves or reconstructs the disposition of any such unit of work until a RESYNC command or an initial start. CICS also saves the disposition of any unit of work about which the resource manager replies "remember" to the second-phase syncpoint invocation, so that if the resource manager cannot commit or roll back as directed, it can request the disposition later for recovery.
To use the saved disposition information, the resource manager must have a record of which units of work are in doubt or "remembered". It can then issue a RESYNC command with a list of these units of work, either in its task-related user exit program or an associated administrative transaction.
In response, CICS creates a task, CRSY, for each in-doubt unit of work in the list. The CRSY task invokes the task-related user exit program once on behalf of its particular unit of work. This invocation is identified to the exit as a phase 2 syncpoint request and as such indicates whether the unit of work was committed or rolled back. The exit program can then relay this information in the form the resource manager requires.
If the resource manager does not want to resynchronize all in-doubt units of work at once, it should specify PARTIAL on the RESYNC command. If it does not, CICS discards disposition information for all the in-doubt units of work that are not in the supplied list, but are part of the resource manager’s resynchronization set. 3
A resource manager is identified by the name of its task-related user exit and, optionally, a qualifier to this name. Use of a qualifier allows multiple instances of the same resource manager to resynchronize independently.
Control is returned to the program that issued the RESYNC command as soon as the CRSY tasks have been scheduled. They run asynchronously, in parallel, according to normal CICS dispatch rules. Consequently, the exit should be enabled, started, and initialized to the point where it can process these invocations before the RESYNC command.
If the exit is not available, a CRSY task will save the disposition of its unit of work, but since this occurs later in time, no exceptional condition occurs on the RESYNC. See the CICS® Customization Guide for full details about resynchronization invocations of task-related user exits.
If CICS fails for some reason, or an
immediate shutdown is performed, the "forget flow" log records that
are written in response to a committed flow being returned from an external
resource manager are lost. This is because anything other than a controlled
CICS shutdown does not call the MVS logger to force the log records onto the
logstream. This can lead to units of work being rebuilt on a subsequent emergency
restart of CICS, if their links to the external resource managers were not
seen to be "forgettable" at the time of the restart. In order to allow
CICS to discard such units of work, the external resource manager can issue
an EXEC CICS RESYNC command to CICS when it reconnects after the CICS system
is restarted. Any units of work that are not passed on the command are treated
as no longer required by CICS.
Units of work are identified by the UEPURID value passed to the task-related user exit.
If PARTIAL is not specified, CICS discards resolution data for any UOWs not passed in the in-doubt list, but which are part of this resource manager’s resynchronization set. 3 This includes data for UOWs that CICS itself is in doubt about.
A task-related user exit program can issue multiple partial resyncs during the lifetime of a connection with its external resource manager. However, it should issue only one full (that is, non-partial) resync during the lifetime of a connection. This is typically done when the connection is first established. Full resyncs imply deletion of UOWs not mentioned in the IDLIST. Only when the external resource manager is not connected to CICS can it be sure that it has a complete list of UOWs to pass to CICS.
When it is in use, this value is assigned to a unit of work by the task-related user exit at the time the unit of work takes place, via the UEPRMQUA value in the user exit parameter list. If the RESYNC command specifies a qualifier, CICS uses only disposition information saved with the same QUALIFIER and ENTRYNAME values. Similarly, it discards saved dispositions only if they have the same two values, were not included in the IDLIST, and PARTIAL was not specified.