Bt_EndTransaction() Function

 

<< Click to Display Table of Contents >>

Navigation:  Support Functions >

 

Bt_EndTransaction() Function

 

Previous pageReturn to chapter overviewNext page

 

Purpose

 

 

Completes the current transaction and writes the changes to the data files

 

 

 

Prototype

 

 

FUNCTION Bt_EndTransaction ( nid  := 0 AS WORD )  AS LOGIC

 

 

 

Argument(s)

 

 

<nId>                (Optional) Client ID to end transaction for

 

 

 

 

Return

 

 

LOGIC        Did the transaction complete succesfully

 

 

 

Description

 

 

Bt_BeginTransaction() begins a transaction, while Bt_EndTransaction() ends a transaction. If the station or server abends prior to the end of the transaction, all updates performed during the transaction will be rolled back. In general, you should begin a transaction after you have locked all necessary records but before you start any updates. End a transaction after all updates have been written to disk with either Bt_UPDATE() or Bt_INSERT(). Unlock records after the end of the transaction.

 

 

 

Example(s)

 

 

* Start transaction

Bt_BeginTransaction()

IF <transaction completed ok>

 * End transaction

 Bt_EndTransaction()

ELSE

 * Roll back transaction

 Bt_AbortTransaction()

ENDIF

 

 

 

 

See Also

 

 

Bt_AbortTransaction(), Bt_BeginTransaction()