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

Public writable transaction. More...

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

Public Member Functions

 WriteTransaction ()
 Constructs inactive write transaction.
 
 WriteTransaction (WriteTransaction &&other)
 Moves transaction to the new object.
 
 WriteTransaction (const WriteTransaction &other)=delete
 
WriteTransactionoperator= (const WriteTransaction &other)=delete
 
WriteTransactionoperator= (WriteTransaction &&other)
 
void commit ()
 Commits transaction submitting all changes.
 
void abort ()
 Aborts transaction cancelling all changes.
 
- Public Member Functions inherited from LMDBAL::Transaction
 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

 WriteTransaction (TransactionID txn, Base *parent)
 Constructs active write transaction.
 
- Protected Member Functions inherited from LMDBAL::Transaction
 Transaction (TransactionID txn, const Base *parent)
 Constructs an active transaction.
 
void reset ()
 Resets inner transaction properties to inactive state.
 

Friends

class Base
 

Additional Inherited Members

- Protected Attributes inherited from LMDBAL::Transaction
TransactionID txn
 Transaction inner handler.
 
bool active
 Transaction state.
 
const Baseparent
 Pointer to the database this transaction belongs to.
 

Detailed Description

Public writable transaction.

This class provides writable transactions you can use to speed to your queries and modifications keeping them thread safe. LMDBAL::WriteTransaction is NOT COPYABLE but MOVABLE. Transaction can be in one of two states: active or terminated. The way to receive an active LMDBAL::WriteTransaction is to call LMDBAL::Base::beginTransaction. You can use LMDBAL::WriteTransaction for everything instead of LMDBAL::Transaction

Active transactions become terminated upon the call of LMDBAL::WriteTransaction::abort or LMDBAL::WriteTransaction::commit. Calling LMDBAL::Transaction::terminate on LMDBAL::WriteTransaction is exactly the same as calling LMDBAL::WriteTransaction::abort.

Active transactions automaticaly terminate themselves upon destruction. For LMDBAL::WriteTransaction default behaviour upon destruction is to abort.

You CAN NOT use inactive transactions for any query.

Member Function Documentation

◆ abort()

void LMDBAL::WriteTransaction::abort ( )

Aborts transaction cancelling all changes.

Transaction becomes terminated after calling this method

◆ commit()

void LMDBAL::WriteTransaction::commit ( )

Commits transaction submitting all changes.

Transaction becomes terminated after calling this method


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