LMDBAL 0.6.0
LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer
|
Public writable transaction. More...
Public Member Functions | |
WriteTransaction () | |
Constructs inactive write transaction. | |
WriteTransaction (WriteTransaction &&other) | |
Moves transaction to the new object. | |
WriteTransaction (const WriteTransaction &other)=delete | |
WriteTransaction & | operator= (const WriteTransaction &other)=delete |
WriteTransaction & | operator= (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 | |
Transaction & | operator= (const Transaction &other)=delete |
Transaction & | operator= (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 Base * | parent |
Pointer to the database this transaction belongs to. | |
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.
void LMDBAL::WriteTransaction::abort | ( | ) |
Aborts transaction cancelling all changes.
Transaction becomes terminated after calling this method
void LMDBAL::WriteTransaction::commit | ( | ) |
Commits transaction submitting all changes.
Transaction becomes terminated after calling this method