#include <transaction.h>
Collaboration diagram for mysqlpp::Transaction:
Public Member Functions | |
Transaction (Connection &conn, bool consistent=false) | |
Constructor. | |
~Transaction () | |
Destructor. | |
void | commit () |
Commits the transaction. | |
void | rollback () |
Rolls back the transaction. |
|
Constructor.
|
|
Destructor. If the transaction has not been committed or rolled back by the time the destructor is called, it is rolled back. This is the right thing because one way this can happen is if the object is being destroyed as the stack is unwound to handle an exception. In that instance, you certainly want to roll back the transaction. |
|
Commits the transaction. This commits all updates to the database using the connection we were created with since this object was created. This is a no-op if the table isn't stored using a transaction-aware storage engine. See CREATE TABLE in the MySQL manual for details. |
|
Rolls back the transaction. This abandons all SQL statements made on the connection since this object was created. This only works on tables stored using a transaction-aware storage engine. See CREATE TABLE in the MySQL manual for details. |