Loading...
 

BeginTXN

BeginTXN

BeginTXN

Stack
Stack Object type / Description
Stack(In) -
Stack(Out) -

starts a transaction. BeginTXN must only be used in exceptional cases. All InstantView® instructions accessing the database automatically start a transaction. BeginTXN within a running transaction has no effect.

Opens a write transaction (unless the database was opened in READ_ONLY mode - see CX_TRANSACTION_MANAGER::OpenDB or CX_TRANSACTION_MANAGER::SetDBMode)

BeginTXN(READ)

Stack
Stack Object type / Description
Stack(In) -
Stack(Out) -

starts a read-only transaction (MVCC). Now read operations are possible simultaneously with update operations of other clients without locking conflicts. However, the client reading with MVCC does not always see the latest version of the objects, but always a consistent state.
If the (physical) databases are not opened in MVCC mode (see OpenDB statement), this is done now and at the end of the transaction they are opened again in normal mode.

If a transaction has already been started, it is continued, i.e. BeginTXN(READ) has no effect. This prevents a writing transaction from being ended prematurely.

If the databases are currently open in MVCC mode, a transaction simply begins.

All attempts to change or create persistent objects, i.e. to write them into the database, are aborted with a corresponding error message.

BeginTXN(READ, AbortTXN)

Stack
Stack Object type / Description
Stack(In) -
Stack(Out) -

... as BeginTXN(READ), but a currently active transaction in update mode is aborted (abort) before the databases are opened in MVCC mode and the new read transaction starts.

BeginTXN(WRITE)

Stack
Stack Description
Stack(In) -
Stack(Out) -

a transaction begins with the intention of changing data. If the (physical) databases are currently open in MVCC mode (compare OpenDB statement), they are opened in normal mode to allow update operations. At the end of the transaction the databases are automatically reopened with MVCC.
When the databases are open in normal mode, a transaction simply starts (as with BeginTXN without operand).

Related topics