API FOR ADVANCED USERS – The class IlsTransaction
performs a series of updates that can all be undone by a rollback()
operation, or all be validated by a commit()
operation.
More...
#include <ilserver/transact.h>
Public Member Functions | |
IlsTransaction (IlsBoolean works_on_persistent_objects=IlsFalse) | |
This constructor creates a transaction. More... | |
~IlsTransaction () | |
Destroying a transaction automatically validates the updates performed during the transaction. | |
IlsTransaction & | commit () |
This member function executes a commit operation that makes all updates performed during the transaction permanent. More... | |
IlsTransaction * | getParentTransaction () const |
This member function returns the parent transaction. It returns 0 if there is no parent transaction. | |
IlsTransaction * | getSubTransaction () const |
This member function returns the child transaction. It returns 0 if there is no child transaction. | |
IlsBoolean | isCommitted () const |
This member function returns IlsTrue if a commit operation has been executed for the transaction, and IlsFalse otherwise. | |
IlsBoolean | isOver () const |
This member function returns IlsTrue if the transaction is completed. | |
IlsBoolean | isRolledBacked () const |
This member function returns IlsTrue if a rollback operation has been executed for the transaction, and IlsFalse otherwise. | |
IlsTransaction & | rollback () |
This member function executes a rollback operation which undoes all updates performed during the transaction. More... | |
Static Public Member Functions | |
static IlsTransaction * | GetTransaction () |
This static member function returns the current transaction if it is still active. | |
static void | SetTransaction (IlsTransaction *) |
This static member function sets the current transaction. It is seldom used. | |
API FOR ADVANCED USERS – The class IlsTransaction
performs a series of updates that can all be undone by a rollback()
operation, or all be validated by a commit()
operation.
Library: server
Transactions can be nested. A transaction can be created while another transaction is being executed. A transaction containing another transaction is referred to as the parent transaction. A transaction contained in another transaction is referred to as the child transaction. A given transaction must not be shared by multiple threads.
IlsLock
, IlsSafeLock
. IlsTransaction::IlsTransaction | ( | IlsBoolean | works_on_persistent_objects = IlsFalse | ) |
This constructor creates a transaction.
works_on_persistent_objects | internal |
IlsTransaction& IlsTransaction::commit | ( | ) |
This member function executes a commit operation that makes all updates performed during the transaction permanent.
Once committed, these updates cannot be undone. A commit operation only affects the parent transaction, if any, or the objects if there is no parent transaction. It never affects a child transaction. Once the commit operation is complete, notification starts.
IlsTransaction& IlsTransaction::rollback | ( | ) |
This member function executes a rollback operation which undoes all updates performed during the transaction.
A rollback operation affects only child transactions, if any.