libcommonc++
0.7
|
A scoped database transaction. More...
#include <SQLDatabase.h++>
Public Member Functions | |
SQLTransaction (SQLDatabase &database) | |
Construct a new SQLTransaction for the given SQLDatabase. More... | |
~SQLTransaction () | |
Destructor. More... | |
void | commit () |
Commit the transaction. More... | |
A scoped database transaction.
SQLTransaction begins a transaction in its constructor, and automatically rolls back the transaction when it goes out of scope, if the transaction had not previously been committed via a call to commit().
SQLTransaction | ( | SQLDatabase & | database | ) |
Construct a new SQLTransaction for the given SQLDatabase.
database | The database. |
SQLException | If a database error occurs. |
~SQLTransaction | ( | ) |
Destructor.
Rolls back the transaction if it has not been committed via a call commit().
void commit | ( | ) |
Commit the transaction.
SQLException | If a database error occurs. |
TimeoutException | If a timeout occurs while waiting for database locks. The call should be retried in this case. |