#include <transactionitf.h>
Inheritance diagram for pqxx::TransactionItf:
Public Member Functions | |
virtual | ~TransactionItf ()=0 |
void | Commit () |
Commit the transaction. | |
void | Abort () |
Abort the transaction. | |
Result | Exec (const char Query[], const PGSTD::string &Desc=PGSTD::string()) |
Execute query. | |
Result | Exec (const PGSTD::string &Query, const PGSTD::string &Desc=PGSTD::string()) |
Execute query. | |
void | ProcessNotice (const char Msg[]) |
Have connection process warning message. | |
void | ProcessNotice (const PGSTD::string &Msg) |
Have connection process warning message. | |
PGSTD::string | Name () const |
ConnectionItf & | Conn () const |
Connection this transaction is running in. | |
Protected Member Functions | |
TransactionItf (ConnectionItf &, const PGSTD::string &TName=PGSTD::string()) | |
void | Begin () |
void | End () throw () |
End transaction. To be called by implementing class' destructor. | |
virtual void | DoBegin ()=0 |
To be implemented by derived implementation class. | |
virtual Result | DoExec (const char Query[])=0 |
virtual void | DoCommit ()=0 |
virtual void | DoAbort ()=0 |
Result | DirectExec (const char C[], int Retries, const char OnReconnect[]) |
Execute query on connection directly. | |
Friends | |
class | Cursor |
class | TableStream |
class | TableReader |
class | TableWriter |
All database access must be channeled through one of these classes for safety, although not all implementations of this interface need to provide full transactional integrity.
Several implementations of this interface are shipped with libpqxx, including the plain Transaction class, the entirely unprotected NonTransaction, and the more cautions RobustTransaction.
|
|
|
Create a transaction. The optional name, if given, must begin with a letter and may contain letters and digits only. |
|
Abort the transaction. No special effort is required to call this function; it will be called implicitly when the transaction is destructed. |
|
Begin transaction. To be called by implementing class, typically from constructor. |
|
Commit the transaction. Unless this function is called explicitly, the transaction will not be committed (actually the NonTransaction implementation breaks this rule, hence the name). Once this function returns, the whole transaction will typically be irrevocably completed in the database. There is also, however, a minute risk that the connection to the database may be lost at just the wrong moment. In that case, libpqxx may be unable to determine whether the transaction was completed or aborted and an in_doubt_error will be thrown to make this fact known to the caller. The RobustTransaction implementation takes some special precautions to reduce this risk. |
|
Connection this transaction is running in.
|
|
Execute query on connection directly.
|
|
|
|
To be implemented by derived implementation class.
|
|
|
|
|
|
End transaction. To be called by implementing class' destructor.
|
|
Execute query. Perform a query in this transaction. This version may be slightly slower than the version taking a const char[], although the difference is not likely to be very noticeable compared to the time required to execute even a simple query.
|
|
Execute query. Perform a query in this transaction.
|
|
|
|
Have connection process warning message.
|
|
Have connection process warning message.
|
|
|
|
|
|
|
|
|