Pathway/iTS TCP and Terminal Programming Guide

Managing Transactions With the TMF Subsystem
Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide426751-001
5-3
TMF Programming in SCREEN COBOL
trails (transaction logs) can include the identity of the transaction responsible for each
database change.
Servers should not reply to request messages until all work for the request has been
completed. The contents of the reply message indicate the outcome of the request,
which is one of the following:
All the work for the request was completed successfully.
None of the work for the request was completed.
The work for the request was only partially completed.
In the first case, the requester can commit the transaction. In the second case, the
requester can abort the transaction and then retry it. In both these cases, the information
in the server’s reply is sufficient to ensure the integrity of the transaction.
However, if the transaction work was only partially completed, the application needs to
ensure that the transaction is not committed so that the incomplete work can be backed
out. To ensure transaction backout, the server should call the ABORTTRANSACTION
procedure after reading the request and before sending its reply. A call to
ABORTTRANSACTION by the server does not end the transaction—only the requester
can end it—but such a call imposes the requirement that the requester use the ABORT-
TRANSACTION statement, rather than the END-TRANSACTION statement, after the
requester’s reply.
The remainder of this section contains detailed information related to writing SCREEN
COBOL requesters that use the TMF subsystem.
TMF Programming in SCREEN COBOL
The SCREEN COBOL language provides the following features to support TMF
transactions:
SCREEN COBOL statements that begin and end a transaction, abort a transaction,
and restart a transaction
Special registers TRANSACTION-ID, TERMINATION-STATUS, and
RESTART-COUNTER
Transaction Mode Use
A terminal program unit (that is, a SCREEN COBOL program executing on behalf of a
terminal) configured for use with the TMF subsystem enters transaction mode when the
BEGIN-TRANSACTION statement is executed and leaves transaction mode when the
END-TRANSACTION or ABORT-TRANSACTION statement is executed.
When BEGIN-TRANSACTION is executed, the transaction is assigned a unique
transaction identifier that distinguishes one transaction from all other transactions. If the
program unit is configured with TMF OFF, the TCP does not allow that program unit to
enter transaction mode, but causes BEGIN-TRANSACTION to issue a null transaction
identifier.