NCBI C++ ToolKit
|
Search Toolkit Book for CBDB_Transaction
BDB transaction object. More...
#include <db/bdb/bdb_trans.hpp>
Public Types | |
enum | ETransSync { eEnvDefault , eTransSync , eTransASync } |
Enum controls if transaction is synchronous or not. More... | |
enum | EKeepFileAssociation { eFullAssociation , eNoAssociation } |
When file is connected to transaction using CBDB_File::SetTransaction() class by default keeps track of all associated files and then drops association on Commit(), Abort() or destruction. More... | |
Public Member Functions | |
CBDB_Transaction (CBDB_Env &env, ETransSync tsync=eEnvDefault, EKeepFileAssociation assoc=eFullAssociation) | |
Construct transaction. More... | |
~CBDB_Transaction () | |
Non-commited transaction is aborted upon the destruction. More... | |
virtual void | Commit () |
Commit transaction. More... | |
virtual void | Rollback () |
Rollback transaction (same as Abort) More... | |
void | Abort () |
Abort transaction. More... | |
DB_TXN * | GetTxn () |
Get low level Berkeley DB transaction handle. More... | |
EKeepFileAssociation | GetAssociationMode () const |
Transaction file association mode. More... | |
virtual void | Add (ITransactional *dbfile) |
Add file to the list of connected files. More... | |
virtual void | Remove (ITransactional *dbfile) |
Remove file from the list of connected files. More... | |
Public Member Functions inherited from ITransaction | |
virtual | ~ITransaction () |
Public Member Functions inherited from ITransactionalRegistry | |
virtual | ~ITransactionalRegistry () |
Static Public Member Functions | |
static CBDB_Transaction * | CastTransaction (ITransaction *trans) |
Downcast ITransaction. More... | |
Protected Types | |
typedef vector< ITransactional * > | TTransVector |
Transaction association list. More... | |
Protected Member Functions | |
bool | IsInProgress () const |
Return TRUE if transaction handle has been requested by some client (File) More... | |
Protected Attributes | |
CBDB_Env & | m_Env |
Associated environment. More... | |
ETransSync | m_TSync |
Sync. flag. More... | |
EKeepFileAssociation | m_Assoc |
Association flag. More... | |
DB_TXN * | m_Txn |
Transaction handle. More... | |
TTransVector | m_TransFiles |
Files connected to transaction. More... | |
Private Member Functions | |
void | x_Abort (bool ignore_errors) |
Abort transaction with error checking or without. More... | |
void | x_DetachFromFiles () |
Forget all. More... | |
CBDB_Transaction (const CBDB_Transaction &trans) | |
CBDB_Transaction & | operator= (const CBDB_Transaction &trans) |
Friends | |
class | CBDB_RawFile |
BDB transaction object.
Transaction is associated with files using CBDB_File::SetTransaction()
Definition at line 61 of file bdb_trans.hpp.