End_Transaction
See Also: Transactions and DDOs, Abort_Transaction, Begin_Transaction, Lock, Unlock, DF_TRANABORT_ONERROR, DF_TRANSACTION_ABORT
Purpose
To explicitly mark the end of a database transaction.
Syntax
End_Transaction
What It Does
Transactions begin with a Begin_Transaction command and end with an End_Transaction command. Transactions are comprised of all the database table operations between the Begin_Transaction and End_Transaction commands. A side effect of the End_Transaction command is to execute an Unlock command.
If an error occurs during a transaction, the entire transaction can be rolled back to its original pre-transaction state. After the End_Transaction command executes, the transaction is over and it may not be rolled back.
Notes
-
Abort_Transaction commands executed after an
End_Transactioncommand will generate an error. -
The
Begin_TransactionandEnd_Transactioncommands must be matched within the same scope. The following would not be legal:Begin_Transaction : // Database update commands. if (Not(Found)) Begin End_Transaction // More code. End