Recovery routines for CAF

You can use abend recovery routines and functional recovery routines (FRRs) to handle unexpected errors. An abend recovery routine controls what happens when an abend occurs while Db2 has control. A functional recovery routine can obtain information about and recover from program errors.

The CAF has no abend recovery routines, but you can provide your own. Any abend recovery routines that you provide must use tracking indicators to determine if an abend occurred during Db2 processing. If an abend occurs while Db2 has control, the recovery routine can take one of the following actions:
  • Allow task termination to complete. Do not try the program again. Db2 detects task termination and terminates the thread with the ABRT parameter. You lose all database changes back to the last sync point or commit point.

    This action is the only action that you can take for abends that are caused by the CANCEL command or by DETACH. You cannot use additional SQL statements. If you attempt to execute another SQL statement from the application program or its recovery routine, you receive a return code of +256 and a reason code of X'00F30083'.

  • In an ESTAE routine, issue a CLOSE function call with the ABRT parameter followed by a DISCONNECT function call. The ESTAE exit routine can try again so that you do not need to reinstate the application task.
FRRs must comply with the following requirements and restrictions:
  • You can use only enabled unlocked task (EUT) FRRs in your routines that call Db2. The standard z/OS® functional recovery routines (FRRs) apply to only code that runs in service request block (SRB) mode, and Db2 does not support calls from SRB mode routines.
  • Do not have an EUT FRR active when using CAF, processing SQL requests, or calling IFI. With z/OS, if you have an active EUT FRR, all Db2 requests fail, including the initial CONNECT or OPEN request. The requests fail because Db2 always creates an ARR-type ESTAE, and z/OS does not allow the creation of ARR-type ESTAEs when an FRR is active.
  • An EUT FRR cannot retry failing Db2 requests. An EUT FRR retry bypasses ESTAE routines from Db2. The next Db2 request of any type, including a DISCONNECT request, fails with a return code of +256 and a reason code of X'00F30050'.