TMF Application Programmer's Guide (H06.06+, J06.03+)

Designing Single-Threaded Processes
HP NonStop TMF Application Programmers Guide540139-009
2-7
Checkpointing Strategy
BEGINTRANSACTION. Such requesters can ignore the existence of the TFILE
altogether.
If a requester is the primary process of a NonStop process pair, however, it must
explicitly open the TFILE and then execute a CHECKOPEN call to create the backup
requester’s copy of the TFILE.
To open the TFILE, a single-threaded requester uses an FILE_OPEN_ call of the
following form (illustrated in TAL).
filename
is the name of a variable containing the logical device name of the TMF
Management Process (TMP). The name is always $TMP. You can obtain the name
programmatically by calling the GETTMPNAME procedure.
filenumber
is the name of a variable into which the FILE_OPEN_ system procedure returns a
unique value identifying this instance of the TFILE. You use filenumber in
CHECKPOINT calls to synchronize the content of the backup requester’s TFILE
with that of the primary requester’s TFILE.
filenumber may be used only in calls to AWAITIO[X], CLOSE, and
FILE_CLOSE_ or as a filenumber in a checkpoint procedure call. Using
filenumber with any other file system procedures will fail with several different
file error codes.
nowait-depth
is the name of a variable containing the FILE_OPEN_ nowait-depth parameter. For
a single-threaded requester, this parameter is either a 0 or a 1 (both specifying that
the requester can have only one transaction in existence at any given time). Zero
(0) indicates that ENDTRANSACTION calls are to be waited, while 1 specifies that
they are to be completed by an AWAITIO call (nowait).
A process can open the TFILE only once; attempts to open multiple instances of the
TFILE, or to open the TFILE after having called BEGINTRANSACTION, will fail with a
condition code of CCL and a file system error number 12 (file in use).
Placement of Checkpoints
If a primary requester process fails while a transaction is in progress, TMF
automatically aborts the transaction. If the backup requester process fails while a
transaction is in progress, and the transaction has been checkpointed, TMF
automatically aborts the transaction.
CALL FILE_OPEN_ ( filename:4 , filenumber , , ,
nowait-depth );