NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
CBDB_Transaction Class Reference

Search Toolkit Book for CBDB_Transaction

BDB transaction object. More...

#include <db/bdb/bdb_trans.hpp>

+ Inheritance diagram for CBDB_Transaction:
+ Collaboration diagram for CBDB_Transaction:

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_TXNGetTxn ()
 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_TransactionCastTransaction (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_Envm_Env
 Associated environment. More...
 
ETransSync m_TSync
 Sync. flag. More...
 
EKeepFileAssociation m_Assoc
 Association flag. More...
 
DB_TXNm_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_Transactionoperator= (const CBDB_Transaction &trans)
 

Friends

class CBDB_RawFile
 

Detailed Description

BDB transaction object.

Transaction is associated with files using CBDB_File::SetTransaction()

Note
Transaction is aborted upon the desctruction of a non-commited transaction object.

Definition at line 61 of file bdb_trans.hpp.


The documentation for this class was generated from the following files:
Modified on Wed Sep 04 15:03:20 2024 by modify_doxy.py rev. 669887