SQLiteC++
0.5.0
SQLiteC++ is a smart and easy to use C++ SQLite3 wrapper.
|
RAII encapsulation of a SQLite Transaction. More...
#include <Transaction.h>
Public Member Functions | |
Transaction (Database &aDatabase) | |
Begins the SQLite transaction. More... | |
virtual | ~Transaction (void) throw () |
Safely rollback the transaction if it has not been committed. More... | |
void | commit (void) |
Commit the transaction. More... | |
RAII encapsulation of a SQLite Transaction.
A Transaction is a way to group multiple SQL statements into an atomic secured operation; either it succeeds, with all the changes committed to the database file, or if it fails, all the changes are rolled back to the initial state.
Resource Acquisition Is Initialization (RAII) means that the Transaction begins in the constructor and is rollbacked in the destructor, so that there is no need to worry about memory management or the validity of the underlying SQLite Connection.
This method also offers big performances improvements compared to individually executed statements.
Definition at line 34 of file Transaction.h.
|
explicit |
Begins the SQLite transaction.
Exception is thrown in case of error, then the Transaction is NOT initiated.
Definition at line 18 of file Transaction.cpp.
|
virtual |
Safely rollback the transaction if it has not been committed.
Definition at line 26 of file Transaction.cpp.
void SQLite::Transaction::commit | ( | void | ) |
Commit the transaction.
Definition at line 44 of file Transaction.cpp.