26#ifndef D_TRANSACTION_HH
27#define D_TRANSACTION_HH
A database object must be instantiated and opened before starting any transaction which uses the data...
Definition database.hh:60
Class r_OId represents an object identifier.
Definition oid.hh:39
Through inheritance of this class, the type definer specifies that the subclass is capable of having ...
Definition object.hh:62
The class r_Ref_Any is defined to support a reference to any type.
Definition ref.hh:65
References of type r_Ref in many respects behave like C++ pointers but provide an additional mechanis...
Definition ref.hh:198
The class implements a set container.
Definition set.hh:42
Transactions can be started, committed, aborted, and checkpointed.
Definition transaction.hh:50
r_TAStatus get_status() const
returns the current state
r_TAMode
possible transaction modes
Definition transaction.hh:63
@ read_write
Definition transaction.hh:64
@ read_only
Definition transaction.hh:65
void begin(r_TAMode mode=read_write)
start the transaction
r_TAMode get_mode() const
returns current mode
r_Ref_Any load_object(const r_OId &oid)
load an object (internal use only)
static r_Transaction * actual_transaction
store a pointer to the actual transaction
Definition transaction.hh:119
~r_Transaction()
destructor, an active transaction is aborted
void abort()
The transaction is committed and changes are made persistent in the database.
void commit()
By default, a transaction is started in write mode.
void add_object_list(GenRefType type, void *ref)
adds a non-r_Object to the list of persistent objects
void setDatabase(r_Database *database)
sets the database reference that this transaction is using.
r_TAStatus
possible states of the transaction
Definition transaction.hh:54
@ inactive
Definition transaction.hh:56
@ aborting
Definition transaction.hh:58
@ comiting
Definition transaction.hh:57
@ active
Definition transaction.hh:55
r_Transaction(r_Database *db=NULL)
create a new transaction object; if the db object is not provided, this class not thread-safe.
r_Database * getDatabase()
returns the database used by this transaction
GenRefType
possible non-r_Object values maintained by the transaction
Definition genreftype.hh:28