RAII transaction.
More...
#include <StormByte/database/transaction.hxx>
RAII transaction.
Rolls back if neither Commit() nor Rollback() ran before destruction.
- Note
- Holds exclusive access to its connection and must remain on its creating thread.
◆ Transaction() [1/3]
| StormByte::Database::Transaction::Transaction |
( |
Database & |
db | ) |
|
|
explicit |
Bind to a database connection.
- Parameters
-
◆ 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 |
Whether neither Commit nor Rollback has been called.
- Returns
- true if still active.
◆ operator=() [1/2]
Copy assignment (deleted).
◆ operator=() [2/2]
Move assignment.
- Parameters
-
- Returns
- *this.
◆ Rollback()
| void StormByte::Database::Transaction::Rollback |
( |
| ) |
|
The documentation for this class was generated from the following file: