DbiEndTran

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiEndTran

Return to chapter overview

C syntax

DBIResult DBIFN DbiEndTran (hDb, hXact, eEnd);

Delphi syntax

function DbiEndTran (hDb: hDBIDb; hXact: hDBIXact; eEnd: eXEnd): DBIResult stdcall;

Description

DbiEndTran ends a transaction on a SQL server table or a local (Paradox, FoxPro, Access, and dBASE) table.

Parameters

hDb                Type: hDBIDb                (Input)
Specifies the database handle.

hXact                Type: hDBIXact                (Input)
Specifies the transaction handle.

eEnd                Type: eXEnd                (Input)
Specifies the transaction end type.

Usage

Ends a transaction that was previously requested. If a commit is done, all changes performed within the transaction against the associated database are made permanent. If an abort is done, all changes performed against the associated database are undone.

xendCOMMIT and xendABORT currently keep cursors if the driver and the database can support it. For xendCOMMIT and xendABORT, if the database cannot support keeping cursors, four possibilities exist for each server cursor opened on behalf of the BDE user:

       A cursor for an open query with pending results is buffered locally. Other than prematurely reading the data, no visible effect remains.
       A cursor opened on a table supporting direct positioning is closed. No other behavior is affected.
       A cursor opened on a table that does not support direct positioning is opened initially in a different transaction or connection context, if the database supports this. This cursor remains open because it exists in a different context from the requested transaction.
       If none of the previous possibilities apply, the cursor is closed and subsequent access to the BDE objects associated with the server cursor returns an error.

For local transactions, xendCOMMITKEEP is not supported by DbiEndTran.

InterBase, Sybase: It is recommended that after a rollback on a dead table you close all cursors that can be closed, reopening if needed.

Prerequisites

DbiBeginTran must have been called first.

DbiResult

Meaning

DBIERR_NONE

The transaction has ended successfully.

See also

DbiBeginTran