The transaction guard. More...
#include <cppdb/frontend.h>
Public Member Functions | |
transaction (session &s) | |
~transaction () | |
void | commit () |
void | rollback () |
The transaction guard.
This class is RAII transaction guard that causes automatic transaction rollback on stack unwind, unless the transaction is committed
cppdb::transaction::transaction | ( | session & | s | ) |
Begin a transaction on session s, calls s.begin()
If the transaction wasn't committed or rolled back calls session::rollback() for the session it was created with.
void cppdb::transaction::commit | ( | ) |
Commit a transaction on the session. Calls session::commit() for the session it was created with.
void cppdb::transaction::rollback | ( | ) |
Rollback a transaction on the session. Calls session::rollback() for the session it was created with.