Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlsTransaction Class Reference

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.
 
IlsTransactioncommit ()
 This member function executes a commit operation that makes all updates performed during the transaction permanent. More...
 
IlsTransactiongetParentTransaction () const
 This member function returns the parent transaction. It returns 0 if there is no parent transaction.
 
IlsTransactiongetSubTransaction () 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.
 
IlsTransactionrollback ()
 This member function executes a rollback operation which undoes all updates performed during the transaction. More...
 

Static Public Member Functions

static IlsTransactionGetTransaction ()
 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.
 

Detailed Description

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.

See also
IlsLock, IlsSafeLock.

Constructor & Destructor Documentation

◆ IlsTransaction()

IlsTransaction::IlsTransaction ( IlsBoolean  works_on_persistent_objects = IlsFalse)

This constructor creates a transaction.

Parameters
works_on_persistent_objectsinternal

Member Function Documentation

◆ commit()

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.

◆ rollback()

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.