LMDBAL 0.6.0
LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer
Loading...
Searching...
No Matches
LMDBAL::Transaction Class Reference

Public read only transaction. More...

Inheritance diagram for LMDBAL::Transaction:
LMDBAL::WriteTransaction

Public Member Functions

 Transaction ()
 Constructs inactive transaction.
 
 Transaction (Transaction &&other)
 Moves transaction to a new object.
 
 Transaction (const Transaction &other)=delete
 
Transactionoperator= (const Transaction &other)=delete
 
Transactionoperator= (Transaction &&other)
 Move-assigns transaction to the new object.
 
virtual ~Transaction ()
 Destroys transaction.
 
void terminate ()
 Terminates transaction if it was active.
 
bool isActive () const
 Returns transaction states.
 

Protected Member Functions

 Transaction (TransactionID txn, const Base *parent)
 Constructs an active transaction.
 
void reset ()
 Resets inner transaction properties to inactive state.
 

Protected Attributes

TransactionID txn
 Transaction inner handler.
 
bool active
 Transaction state.
 
const Baseparent
 Pointer to the database this transaction belongs to.
 

Friends

class Base
 
class iStorage
 

Detailed Description

Public read only transaction.

This class provides read only transactions you can use to speed to your queries keeping them thread safe. LMDBAL::Transaction is NOT COPYABLE but MOVABLE. Transaction can be in one of two states: active or terminated. The way to receive an active LMDBAL::Transaction is to call LMDBAL::Base::beginReadOnlyTransaction.

Active transactions become terminated upon the call of LMDBAL::Transaction::terminate. Active transactions automaticaly terminate themselves upon destruction.

You CAN NOT use inactive transactions for any query.

Member Function Documentation

◆ isActive()

bool LMDBAL::Transaction::isActive ( ) const

Returns transaction states.

Returns
true if the transaction is active, false otherwise

◆ terminate()

void LMDBAL::Transaction::terminate ( )

Terminates transaction if it was active.

Transaction becomes terminated after calling this method


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