#include <transaction.hxx>
Inheritance diagram for pqxx::transaction< ISOLATIONLEVEL >:

Public Types | |
| typedef isolation_traits< ISOLATIONLEVEL > | isolation_tag |
| If nothing else is known, our isolation level is at least read_committed. | |
Public Member Functions | |
| transaction (connection_base &C, const PGSTD::string &TName) | |
| Create a transaction. | |
| transaction (connection_base &C) | |
| virtual | ~transaction () throw () |
This is the type you'll normally want to use to represent a transaction on the database.
While you may choose to create your own transaction object to interface to the database backend, it is recommended that you wrap your transaction code into a transactor code instead and let the transaction be created for you.
Usage example: double all wages
extern connection C; work T(C); try { T.exec("UPDATE employees SET wage=wage*2"); T.commit(); // NOTE: do this inside try block } catch (const exception &e) { cerr << e.what() << endl; T.abort(); // Usually not needed; same happens when T's life ends. }
| typedef isolation_traits<ISOLATIONLEVEL> pqxx::transaction< ISOLATIONLEVEL >::isolation_tag |
If nothing else is known, our isolation level is at least read_committed.
Reimplemented from pqxx::transaction_base.
| pqxx::transaction< ISOLATIONLEVEL >::transaction | ( | connection_base & | C, | |
| const PGSTD::string & | TName | |||
| ) | [explicit] |
Create a transaction.
| C | Connection for this transaction to operate on | |
| TName | Optional name for transaction; must begin with a letter and may contain letters and digits only |
| pqxx::transaction< ISOLATIONLEVEL >::transaction | ( | connection_base & | C | ) | [explicit] |
| virtual pqxx::transaction< ISOLATIONLEVEL >::~transaction | ( | ) | throw () [virtual] |
1.5.1