Bt_BeginTransaction() Function

 

<< Click to Display Table of Contents >>

Navigation:  Support Functions >

 

Bt_BeginTransaction() Function

 

Previous pageReturn to chapter overviewNext page

 

Purpose

 

 

Begin a transaction and start buffering operations

 

 

 

Prototype

 

 

FUNCTION Bt_BeginTransaction ( lConcurrent AS LOGIC, nid  := 0 AS WORD )  AS LOGIC

 

 

 

Argument(s)

 

 

<lConcurrent>Does the transaction have to be concurrent
<nId>(Optional) Client ID to start transaction for

 

 

 

 

Return

 

 

LOGICTRUE if successful.

 

 

 

Description

 

 

Bt_BeginTransaction) begins a transaction, while Bt_EndTransaction ends a transaction. Ifthe 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.

 

Note

Do not open files during a 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_EndTransaction()