COBOL Manual for TNS and TNS/R Programs
Fault-Tolerant Processes
HP COBOL Manual for TNS and TNS/R Programs—522555-006
32-3
Introduction to TMF
Introduction to TMF
The HP NonStop™ Transaction Management Facility (TMF) relies on the principle of
archiving and backing out transactions. Every transaction has a beginning and an end.
If the entire transaction cannot be completed (due to some single point of failure), any
changes made to the database must be backed out. This means that other processes
must be kept from using any of the records that a transaction has modified until the
transaction has been completed.
If you are writing a Pathway server in HP COBOL, and the Pathway application will use
TMF, your design is much simpler than it would be if you used the fault-tolerant facility.
All an HP COBOL server needs to do to be fault tolerant under these conditions is to
lock every record it is going to change before changing the record, and lock any record
it reads that affects the course of the transaction. All other coding for fault tolerance is
at the requester level—the SCREEN COBOL program includes BEGIN
TRANSACTION, END TRANSACTION, and ABORT TRANSACTION statements.
If you want an HP COBOL program that is not a Pathway server to run under TMF, you
must include ENTER statements to call the routines BEGINTRANSACTION,
ENDTRANSACTION, and so on.
Choosing the Fault-Tolerant Facility or TMF
If your program is updating unaudited files and you want it to be fault tolerant, you must
code it to use the fault-tolerant facility; otherwise, whether to use the fault-tolerant
facility or TMF is primarily a question of efficiency versus maintenance.
TMF is implemented with process pairs, so when you use TMF you are using the fault-
tolerant facility indirectly. Using the fault-tolerant facility directly makes the program run
more efficiently; however, maintenance is easier with TMF, because the programming
and debugging of the process pairs has already been done for you.
It is easier to configure the system for TMF and to design, implement, and maintain
servers that use TMF than it is to design, implement, and maintain process pairs. The
auditing operation takes processing time. The audit trails take disk space and require
tape operations. But just as Pathway/TS frees the application programmers from
having to produce and support multithreaded requesters, TMF frees them from having
to produce and maintain process pairs.
Fault-Tolerant Facility
The fault-tolerant facility is software that HP provides but that you must explicitly call to
cause a loadfile to be executed as a process pair.
You must include a NONSTOP directive in your compilation before the PROCEDURE
DIVISION header. You must include one STARTBACKUP statement to create the
backup process, and a number of CHECKPOINT statements to transmit restart
information to the backup process. Finally, you must run the program as a named
process (to learn how, see Process Names).