TRANSACTION BEGIN
Begin Tracking Record Changes
This directive must be executed before I/O directives that alter or delete the contents of a record can be recovered. Users may perform many I/O operations before all or none of them are made permanently to the data base. All records that have been altered are locked until a commitment has been made in regard to this TRANSACTION BEGIN.
Syntax
Section titled “Syntax”TRANSACTION BEGIN [,ERR=line-ref|,ERC=error-code]line-ref- is the program line number or label to branch to if this directive produces an error.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”If a LOG OPEN directive is not executed before a TRANSACTION BEGIN directive, the TRANSACTION BEGIN will perform a LOG OPEN using the values in PRM TPLOGPATH and TPLOGNAME. The default value for TPLOGPATH is /usr/lib/basic/TPLOGS (or your Windows home path) and the default value for TPLOGNAME is “TPLOG.”+ TaskId.
Only one TRANSACTION BEGIN directive can be active.
You cannot perform a LOG CLOSE in between a TRANSACTION BEGIN and a COMMIT or ROLLBACK sequence.
Starting with release level 8.3.1 you can OPEN additional data files after the
TRANSACTION BEGIN command is executed.
Starting with release level 8.6.0 you can CLOSE channels between a TRANSACTION BEGIN and a COMMIT or ROLLBACK. However, CLOSEd channels will not be available until a COMMIT or ROLLBACK directive is executed. This restriction ensures that all locks will remain in effect.
Examples
Section titled “Examples”00010 TRANSACTION BEGIN00020 CH1=UNT; OPEN(CH1) "MSORTFILE"00030 CH2=UNT; OPEN(CH2) "DIRECTFILE"00040 CLEAR ERC; K$ = KEY(CH1); READ RECORD(CH1) A$; WRITE RECORD (CH2,KEY=K$,ERC=99) A$; REMOVE(CH1,KEY=K$,ERC=99); IF ERC ROLLBACK ELSE COMMIT FISee also
Section titled “See also”COMMIT, LOG CLOSE, LOG OPEN, and ROLLBACK directives
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF