RAII wrapper for a database transaction.
More...
#include <transaction.hxx>
RAII wrapper for a database transaction.
Rolls back automatically if neither Commit() nor Rollback() is called before destruction.
◆ Transaction() [1/3]
| StormByte::Database::Transaction::Transaction |
( |
Database & |
db | ) |
|
|
explicitnoexcept |
◆ Transaction() [2/3]
| StormByte::Database::Transaction::Transaction |
( |
const Transaction & |
| ) |
|
|
delete |
Copy constructor (deleted).
◆ Transaction() [3/3]
| StormByte::Database::Transaction::Transaction |
( |
Transaction && |
other | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
◆ ~Transaction()
| StormByte::Database::Transaction::~Transaction |
( |
| ) |
|
|
noexcept |
Destructor. Rolls back if still active.
◆ Commit()
| void StormByte::Database::Transaction::Commit |
( |
| ) |
|
◆ IsActive()
| bool StormByte::Database::Transaction::IsActive |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- true if neither Commit nor Rollback has been called.
◆ operator=() [1/2]
Copy assignment (deleted).
◆ operator=() [2/2]
Move assignment.
- Parameters
-
- Returns
- *this
◆ Rollback()
| void StormByte::Database::Transaction::Rollback |
( |
| ) |
|
Rolls back the transaction.
The documentation for this class was generated from the following file:
- /home/runner/work/StormByte-Database/StormByte-Database/lib/public/StormByte/database/transaction.hxx