Use DatabaseTransaction to ensure a transaction is rolled back if an exception is thrown. More...
#include <DatabaseTransaction.h>

Public Member Functions | |
| DatabaseTransaction (DatabaseWrapper &dbw) SSRC_DECL_THROW(DatabaseException) | |
| DatabaseTransaction (Database &db) SSRC_DECL_THROW(DatabaseException) | |
| void | end () SSRC_DECL_THROW(DatabaseException) |
| void | rollback () SSRC_DECL_THROW(DatabaseException) |
| ~DatabaseTransaction () | |
Detailed Description
Use DatabaseTransaction to ensure a transaction is rolled back if an exception is thrown.
DatabaseTransaction begins a database transaction in its constructor. If DatabaseTransaction::end() is called before the instance is destroyed, the transaction is committed. Otherwise, the destructor rolls back the transaction.
Definition at line 70 of file DatabaseTransaction.h.
Constructor & Destructor Documentation
| DatabaseTransaction::DatabaseTransaction | ( | DatabaseWrapper & | dbw | ) | [inline] |
Definition at line 77 of file DatabaseTransaction.h.
| DatabaseTransaction::DatabaseTransaction | ( | Database & | db | ) | [inline] |
Definition at line 85 of file DatabaseTransaction.h.
| DatabaseTransaction::~DatabaseTransaction | ( | ) | [inline] |
Definition at line 106 of file DatabaseTransaction.h.
References rollback().
Member Function Documentation
| void DatabaseTransaction::end | ( | ) | [inline] |
| void DatabaseTransaction::rollback | ( | ) | [inline] |
Definition at line 99 of file DatabaseTransaction.h.
Referenced by ~DatabaseTransaction().
The documentation for this class was generated from the following file: