IlsTransaction
 
IlsTransaction
Category 
Modeling class - API FOR ADVANCED USERS
Inheritance Path 
IlsTransaction
Description 
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.
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.
Library 
<server>
Header File 
#include <ilserver/transact.h>
Synopsis 
class IlsTransaction
{
public:
IlsTransaction();
 
~IlsTransaction();
 
IlsTransaction& commit();
IlsTransaction& rollback();
IlsTransaction* getParentTransaction()const;
IlsTransaction* getSubTransaction()const;
IlsBoolean isCommitted()const;
IlsBoolean isRolledBack()const;
IlsBoolean isOver() const;
static IlsTransaction* GetTransaction();
static void SetTransaction(IlsTransaction*);
};
Constructor 
IlsTransaction();
This constructor creates a transaction.
Destructor 
~IlsTransaction();
Destroying a transaction automatically validates the updates performed during the transaction.
Member Functions 
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& 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.
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 isRolledBack()const;
This member function returns IlsTrue if a rollback operation has been executed for the transaction, and IlsFalse otherwise.
IlsBoolean isOver() const;
This member function returns IlsTrue if the transaction is completed.
[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.
See Also 
IlsLock, IlsSafeLock

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.