Recovering CICS indoubt units of recovery
When the CICS® attachment facility abends, CICS and Db2 build lists of indoubt units of work, either dynamically or during restart, depending on the failing subsystem. If any units of recovery are indoubt at connect time, you can recover from this situation.
Symptoms
One of the following messages is sent to the user-named CICS destination that is specified for the MSGQUEUEn(name) attribute in the RDO (resource definition online): DSN2001I, DSN2034I, DSN2035I, or DSN2036I.Causes
For CICS, a Db2 unit of recovery might be indoubt if the forget entry (X'FD59') of the task-related installation exit routine is absent from the CICS system journal. The indoubt condition applies only to the Db2 unit of recovery in this case because CICS already committed or backed out any changes to its resources.
A Db2 unit of recovery is indoubt for Db2 if an End Phase 1 is present and the Begin Phase 2 is absent.
Environment
The following table summarizes the situations that can exist when CICS units of recovery are indoubt.
| Message ID | Meaning |
|---|---|
| DSN2001I | The named unit of recovery cannot be resolved by CICS because CICS was cold started. The CICS attachment facility continues the startup process. |
| DSN2034I | The named unit of recovery is not indoubt for Db2, but it is indoubt according to CICS log information. The reason is probably a CICS restart with the wrong tape. The problem might also be caused by a Db2 restart to a prior point in time. |
| DSN2035I | The named unit of recovery is indoubt for Db2, but it is not in the CICS indoubt list. This is probably due to an incorrect CICS restart. The CICS attachment facility continues the startup process and provides a transaction dump. The problem might also be caused by a Db2 restart to a prior point in time. |
| DSN2036I | CICS indicates rollback for the named unit of recovery, but Db2 has already committed the unit of recovery. The CICS attachment facility continues the startup process. |
CICS retains details of indoubt units of recovery that were not resolved during connection startup. An entry is purged when it no longer shows up on the list that is presented by Db2 or, when the entry is present in the list, when Db2 resolves it.
Resolving the problem
Obtain a list of the indoubt units of recovery from Db2 by issuing the following command:
-DISPLAY THREAD (connection-name) TYPE (INDOUBT)Messages like these are then issued:
DSNV401I - DISPLAY THREAD REPORT FOLLOWS - DSNV406I - INDOUBT THREADS - COORDINATOR STATUS RESET URID AUTHID coordinator_name status yes/no urid authid DISPLAY INDOUBT REPORT COMPLETE DSN9022I - DSNVDT '-DISPLAY THREAD' NORMAL COMPLETIONThe corr_id (correlation ID) for CICS Transaction Server for z/OS 1.2 and subsequent releases of CICS consists of:- Bytes 1 - 4
- Thread type: COMD, POOL, or ENTR
- Bytes 5 - 8
- Transaction ID
- Bytes 9 - 12
- Unique thread number
Two threads can sometimes have the same correlation ID when the connection has been broken several times and the indoubt units of recovery have not been resolved. In this case, use the network ID (NID) instead of the correlation ID to uniquely identify indoubt units of recovery.
The network ID consists of the CICS connection name and a unique number that is provided by CICS at the time that the syncpoint log entries are written. This unique number is an 8-byte store clock value that is stored in records that are written to both the CICS system log and to the Db2 log at syncpoint processing time. This value is referred to in CICS as the recovery token.
- Scan the CICS log for entries
that are related to a particular unit of recovery. Look for a PREPARE
record (JCRSTRID X'F959'), for the task-related installation
where the recovery token field (JCSRMTKN) equals the value that is
obtained from the network-ID. The network ID is supplied by Db2 in the DISPLAY
THREAD command output.
You can find the CICS task number by locating the prepare log record in the CICS log for indoubt units of recovery. Using the CICS task number, you can locate all other entries on the log for this CICS task.
You can use the CICS journal print utility DFHJUP to scan the log.
- Use the change log inventory utility (DSNJU003) to scan the Db2 log for
entries that are related to a particular unit of recovery. Locate
the End Phase 1 record with the required network ID. Then use the
URID from this record to obtain the rest of the log records for this
unit of recovery.
When scanning the Db2 log, note that the Db2 startup message DSNJ099I provides the start log RBA for this session.
- If needed, do indoubt resolution in Db2.
To invoke Db2 to take the recovery action for an indoubt unit of recovery, issue the Db2 RECOVER INDOUBT command, where the correlation_id is unique:
DSNC -RECOVER INDOUBT (connection-name) ACTION (COMMIT/ABORT) ID (correlation_id)If the transaction is a pool thread, use the value of the correlation ID (corr_id) that is returned by DISPLAY THREAD for thread#.tranid in the RECOVER INDOUBT command. In this case, the first letter of the correlation ID is P. The transaction ID is in characters five through eight of the correlation ID.
If the transaction is assigned to a group (group is a result of using an entry thread), use thread#.groupname instead of thread#.tranid. In this case, the first letter of the correlation ID is a G, and the group name is in characters five through eight of the correlation ID. The groupname is the first transaction that is listed in a group.
Where the correlation ID is not unique, use the following command:
DSNC -RECOVER INDOUBT (connection-name) ACTION (COMMIT|ABORT) NID (network-id)When two threads have the same correlation ID, use the NID keyword instead of the ID keyword. The NID value uniquely identifies the work unit.
To recover all threads that are associated with connection-name, omit the ID option.
The command results that are in either of the following messages indicate whether the thread is committed or rolled back:
DSNV414I - THREAD thread#.tranid COMMIT SCHEDULED DSNV414I - THREAD thread#.tranid ABORT SCHEDULED
When you resolve indoubt units of work, note that CICS and the CICS attachment facility are not aware of the commands to Db2 to commit or abort indoubt units of recovery because only Db2 resources are affected. However, CICS keeps details about the indoubt threads that could not be resolved by Db2. This information is purged either when the presented list is empty or when the list does not include a unit of recovery that CICS remembers.
Investigate any inconsistencies that you found in the preceding steps.