|
Database Transaction. More...
#include <Transaction.h>
Public Member Functions | |
| Transaction (const DatabaseConnection &db) | |
| ~Transaction () | |
| Transaction (const Transaction &)=delete | |
| Transaction & | operator= (const Transaction &)=delete |
| void | begin () |
| void | commit () |
| void | rollback () |
| bool | active () const |
Database Transaction.
Allows to begin, commit, and rollback the transaction automatically. If the transaction object is deleted w/o commiting or rolling back the transaction, it rolls back the transaction (if active)
|
explicit |
Constructor
| db | DatabaseConnection&, the database to work with |
| sptk::Transaction::~Transaction | ( | ) |
Destructor
|
inline |
Is transaction active?
| void sptk::Transaction::begin | ( | ) |
Begins the transaction
| void sptk::Transaction::commit | ( | ) |
Commits the transaction
| void sptk::Transaction::rollback | ( | ) |
Rolls back the transaction