SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
T-6
TMF Transactions
TMF Transactions
The TMF subsystem simplifies the task of maintaining data consistency for a
distributed database being updated by concurrent transactions.
A TMF transaction (a set of database changes that must be completed as a group) is
the basic recoverable unit if a failure or transaction interruption occurs. TMF
transactions can be defined during an SQLCI session or in a host program. The typical
order of events is:
1. Transaction is started.
2. Database changes are made.
3. Transaction is committed.
If, however, the changes cannot be made or the user does not want to complete the
transaction, the transaction can be aborted so the database is rolled back to its original
state.
Transaction Control Statements
The statements in this table control TMF transactions.
Statements that control TMF transactions can be used from SQLCI or coded in an
application.
For the TMF subsystem, the statements for each function are equivalent. Error
processing, however, depends on the language of the statement.
User-Defined and System-Defined Transactions
TMF transactions you define are called user-defined transactions. In some
cases, NonStop SQL/MP defines transactions for you. These transactions are called
system-defined transactions. System-defined transactions and the operations
that cause them are discussed in later sections.
Function Language Transaction Control Statement
Start SQL/MP
COBOL
C, Pascal, TAL
SCREEN COBOL
BEGIN WORK
ENTER TAL BEGINTRANSACTION
BEGINTRANSACTION
BEGIN-TRANSACTION
Commit SQL/MP
COBOL
C, Pascal, TAL
SCREEN COBOL
COMMIT WORK
ENTER TAL ENDTRANSACTION
ENDTRANSACTION
END-TRANSACTION
Abort SQL/MP
COBOL
C, Pascal, TAL
SCREEN COBOL
ROLLBACK WORK
ENTER TAL ABORTTRANSACTION
ABORTTRANSACTION
ABORT-TRANSACTION