IBM SC33-1683-02 Server User Manual


 
Chapter 7. Writing a transaction restart program
The transaction restart user-replaceable program (DFHREST) enables you to
participate in the decision as to whether a transaction should be restarted or not.
CICS invokes DFHREST when a transaction abends, if RESTART(YES) is specified
in the transaction’s resource definition (the default is RESTART(NO)).
The default program requests restart under certain conditions; for example, in the
event of a program isolation deadlock (that is, when two tasks each wait for the
other to release a particular DL/I database segment or file record), one of the tasks
is backed out and automatically restarted, and the other is allowed to complete its
update.
For general information about restarting transactions, see the
CICS Recovery and
Restart Guide
.
Notes:
1. If your transaction restart program chooses to restart a transaction, a new task
is attached that invokes the initial program of the transaction. This is true even if
the task abended in the second or subsequent UOW, and DFHREST requested
a restart.
2. Statistics on the total number of restarts against each transaction are kept.
3. Emergency restart does not restart any tasks.
4. In some cases, the benefits of transaction restart can be obtained instead by
using the SYNCPOINT ROLLBACK command. Although use of the ROLLBACK
command is not usually recommended, it does keep all the executable code in
the application programs. For more information about the use of the ROLLBACK
option when working in an ISC or MRO environment, see the
CICS
Intercommunication Guide
.
When planning to replace the default DFHREST, check to see if the logic of any of
your transactions is inappropriate for restart.
v Transactions that execute as a single unit of work are safe. Those that execute a
loop, and on each pass reading one record from a recoverable destination,
updating other recoverable resources, and closing with a syncpoint, are also
safe.
v There are two types of transaction that need to be modified to avoid erroneously
repeating work done in the units of work that precede an abend:
1. A transaction in which the first and subsequent units of work change different
resources
2. A transaction where the contents of the input data area are used in several
units of work.
© Copyright IBM Corp. 1977, 1999 411