|
cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
The Transaction class - This is a helper class to create scoped transactions. More...
#include <sql.h>
Public Member Functions | |
| Transaction (const QSqlDatabase &database) | |
| Transaction (const QString &databaseName=QString()) | |
| bool | commit () |
| bool | rollback () |
| bool | transaction () const |
This is a helper class to create scoped transactions, when you create a local Transaction object it will automatically open a transaction, you can check if the transaction was created successfully by calling transaction(),
Once this object goes out of scope it will automatically rollback the transaction if the transaction was open and commit() was not called. It helps you forgetting to rollback a transaction in case of an error.
| Sql::Transaction::Transaction | ( | const QSqlDatabase & | database | ) |