COBOL Manual for TNS and TNS/R Programs
Fault-Tolerant Processes
HP COBOL Manual for TNS and TNS/R Programs—522555-006
32-18
Designing Programs for the TMF Subsystem
Record Locking
As a transaction progresses in TMF, these types of resources must be locked:
•
Records that are changed or inserted into the database
•
Records whose values affect the course of the transaction
•
Keys of deleted records
If you are going to rewrite a record in an audited file, you must first lock it when you
read it. The TMF subsystem automatically locks records that are inserted and keys of
records that are deleted.
If a process attempts to rewrite a record in an audited file without that record being
locked, the operation terminates with a file system error 80 (invalid operation attempted
on audited file or non-audited disk volume) and file status code “30” (permanent error).
If the process executes an UNLOCK operation on a record that was locked and
modified in an audited file, TMF prevents the record from actually being unlocked until
the transaction is completed or aborted. The TMF subsystem automatically unlocks
these locked records at the end of a transaction, whether the process explicitly unlocks
them or not. If there is any chance that the same logic will be run on audited files at
some times and on non-audited files at other times, it is best to specify explicit
unlocking operations.
If you unlock a record in a nonaudited file in TMF or unlock a record that you locked
but did not modify, the unlock operation occurs immediately.
Designing Programs for the TMF Subsystem
Like any other programming task, the most important part of designing for TMF is
planning. Someone must plan the training, hardware, development, installation, testing,
and operation.
Before development can proceed, the designers must be trained in TMF. Eventually,
some training is necessary for everyone involved.
When the designers understand TMF, the project must be planned. Identify the
transactions in the system. Do all transactions need to be protected by TMF? Are the
transactions of appropriate size (number of SEND operations and number of screens
involved)?
The entire installation must be scheduled, whether you are converting to TMF, adding a
TMF project on a system that is already using TMF, or creating a new system.
Testing must be planned. Application code should be tested first without TMF, then with
TMF. Operations and development groups must practice recovery procedures.
Daily operation must be planned. Determine the frequency of online dumps and
whether the dump is to tape or disk. Determine how the archival tapes or disks are
transported to storage and how they are retrieved. Have a disaster recovery script.
Practice disaster recovery occasionally.