rasdaman complete source
Classes | Public Types | Public Member Functions | List of all members
r_Transaction Class Reference

#include <transaction.hh>

Public Types

enum  r_TAStatus { active, inactive, comiting, aborting }
 possible states of the transaction More...
 
enum  r_TAMode { read_write, read_only }
 possible transaction modes More...
 

Public Member Functions

 r_Transaction ()
 default constructor More...
 
 ~r_Transaction ()
 destructor, an active transaction is aborted More...
 
void begin (r_TAMode mode=read_write) throw ( r_Error )
 start the transaction More...
 
void commit () throw ( r_Error )
 commit transaction and make changes persistent More...
 
void abort ()
 abort transaction and forget changes within transaction More...
 
r_TAStatus get_status () const
 returns the current state More...
 
r_TAMode get_mode () const
 returns current mode More...
 
enum  GenRefType {
  MINTERVAL, SINTERVAL, POINT, OID,
  SCALAR
}
 possible non-r_Object values maintained by the transaction More...
 
static r_Transactionactual_transaction
 store a pointer to the actual transaction More...
 
r_Ref_Any load_object (const r_OId &oid)
 load an object (internal use only) More...
 
void add_object_list (GenRefType type, void *ref)
 adds a non-r_Object to the list of persistent objects More...
 

Constructor & Destructor Documentation

r_Transaction::r_Transaction ( )

default constructor

r_Transaction::~r_Transaction ( )

destructor, an active transaction is aborted

Member Function Documentation

void r_Transaction::abort ( )

abort transaction and forget changes within transaction

The transaction is committed and changes are made persistent in the database. While committing, the following errors can occur:

{tabular}{lll} r_Error_TransferFailed && Server communication problem.\ r_Error_ObjectUnknown && Name of object is unknown.\ r_Error_DatabaseClassUndefined && Type name of object not known by the database.\ r_Error_CollectionElementTypeMismatch && Collection and MDD type mismatch.\ {tabular}

void r_Transaction::begin ( r_TAMode  mode = read_write)
throw (r_Error
)

start the transaction

void r_Transaction::commit ( )
throw (r_Error
)

commit transaction and make changes persistent

By default, a transaction is started in write mode. If the read_only mode is specified, no write operations are allowed within the transaction anymore. If any write operation occurs in read_only mode, the exception r_Error with kind { r_Error_TransactionReadOnly} will be raised and the transaction will be aborted. In order to achieve maximal performance, read-only transactions should be used whenever posssible, i.e., when no update operations occur within this transaction.

r_TAMode r_Transaction::get_mode ( ) const
inline

returns current mode

r_TAStatus r_Transaction::get_status ( ) const
inline

returns the current state


The documentation for this class was generated from the following file: