Introduction to Data Management
Ensuring Database Consistency With TMF
7-6 15873 Tandem Computers Incorporated
Figure 7-4. TMF Operations
S8020-02
4
BEGIN-TRANSACTION
Modify
Database
END-TRANSACTION
Transaction
Starts
Server Processes
Change Database
TMF Verifies and
Holds Locks as it
Builds Audit Trails
TMF
Verifies Audit Trails
are Complete when
it Releases Locks
Screen Program
Stage 1
Stage 2
Stage 3
But if an error occurs during execution of any statement in the bracketed code, the
transaction aborts; the effects of all previously executed statements within the bounds
of the transaction are backed out and have no effect on the database; the transaction
fails completely.
To support transaction backout, TMF consults its audit trail, locates the audit trail
records for the updates performed up to this point in the transaction, and applies the
before-images of each record to the database. Then, TMF releases the locks it held on
all records affected by the transaction.
Other TMF functions are available to programmers coding in SCREEN COBOL. For
example, ABORT-TRANSACTION aborts the transaction and RESTART-
TRANSACTION terminates the transaction and then restarts it from the beginning.
When you generate applications with PATHMAKER, you need not write the
statements that delimit your transaction boundaries—you simply designate the
transactions you wish protected, and PATHMAKER automatically generates these
statements as it produces your SCREEN COBOL code.
Other statements are available for bracketing transactions in NonStop SQL. In fact,
the services of TMF are not restricted to the PATHWAY environment—you can call
upon these services from many other languages, including: BASIC, C, FORTRAN,
COBOL85, COBOL 74, Pascal, and the Transaction Application Language (TAL).