libpqxx: pqxx::dbtransaction Class Reference

libpqxx 4.0.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
pqxx::dbtransaction Class Reference

`#include <dbtransaction.hxx>`

Inheritance diagram for pqxx::dbtransaction:

## Public Member Functions
virtual | ~dbtransaction ()
Public Member Functions inherited from pqxx::transaction_base
virtual | ~transaction_base ()=0
void | commit ()
| Commit the transaction.
void | abort ()
| Abort the transaction.
std::string | esc (const char str[]) const
| Escape string for use as SQL string literal in this transaction.
std::string | esc (const char str[], size_t maxlen) const
| Escape string for use as SQL string literal in this transaction.
std::string | esc (const std::string &str) const
| Escape string for use as SQL string literal in this transaction.
std::string | esc_raw (const unsigned char str[], size_t len) const
| Escape binary data for use as SQL string literal in this transaction.
std::string | esc_raw (const std::string &) const
| Escape binary data for use as SQL string literal in this transaction.
template<typename T >
std::string | quote (const T &t) const
| Represent object as SQL string, including quoting & escaping.
std::string | quote_raw (const unsigned char str[], size_t len) const
| Binary-escape and quote a binarystring for use as an SQL constant.
std::string | quote_raw (const std::string &str) const
std::string | quote_name (const std::string &identifier) const
| Escape an SQL identifier for use in a query.
result | exec (const std::string &Query, const std::string &Desc=std::string())
| Execute query.
result | exec (const std::stringstream &Query, const std::string &Desc=std::string())
internal::parameterized_invocation | parameterized (const std::string &query)
| Parameterize a statement.
connection_base & | conn () const
| Connection this transaction is running in.
void | set_variable (const std::string &Var, const std::string &Val)
| Set session variable in this connection.
std::string | get_variable (const std::string &)
| Get currently applicable value of variable.
prepare::invocation | prepared (const std::string &statement=std::string())
| Execute prepared statement.
void | process_notice (const char Msg[]) const
| Have connection process warning message.
void | process_notice (const std::string &Msg) const
| Have connection process warning message.
Public Member Functions inherited from pqxx::internal::namedclass
| namedclass (const std::string &Classname, const std::string &Name="")
const std::string & | name () const throw ()
const std::string & | classname () const throw ()
std::string | description () const

## Protected Member Functions
| dbtransaction (connection_base &, const std::string &IsolationString, readwrite_policy rw=read_write)
| dbtransaction (connection_base &, bool direct=true, readwrite_policy rw=read_write)
void | start_backend_transaction ()
| Start a transaction on the backend and set desired isolation level.
virtual void | do_begin ()
| Sensible default implemented here: begin backend transaction.
virtual result | do_exec (const char Query[])
| Sensible default implemented here: perform query.
virtual void | do_commit ()=0
| To be implemented by derived class: commit backend transaction.
virtual void | do_abort ()
| Sensible default implemented here: abort backend transaction.
Protected Member Functions inherited from pqxx::transaction_base
| transaction_base (connection_base &c, bool direct=true)
| Create a transaction (to be called by implementation classes only)
void | Begin ()
| Begin transaction (to be called by implementing class)
void | End () throw ()
| End transaction. To be called by implementing class' destructor.
result | DirectExec (const char C[], int Retries=0)
| Execute query on connection directly.
void | reactivation_avoidance_clear () throw ()
| Forget about any reactivation-blocking resources we tried to allocate.

## Static Protected Member Functions
static std::string | fullname (const std::string &ttype, const std::string &isolation)

## Additional Inherited Members
Public Types inherited from pqxx::transaction_base
typedef isolation_traits < read_committed > | isolation_tag
| If nothing else is known, our isolation level is at least read_committed.
Protected Attributes inherited from pqxx::transaction_base
internal::reactivation_avoidance_counter | m_reactivation_avoidance
| Resources allocated in this transaction that make reactivation impossible.

## Constructor & Destructor Documentation

pqxx::dbtransaction::~dbtransaction | ( |  | ) |
| virtual

pqxx::dbtransaction::dbtransaction | ( | connection_base & | C,
|  | const std::string & | IsolationString,
|  | readwrite_policy | rw = `read_write`
| ) |  |
| protected

pqxx::dbtransaction::dbtransaction | ( | connection_base & | C,
|  | bool | direct = `true`,
|  | readwrite_policy | rw = `read_write`
| ) |  |
| explicitprotected

## Member Function Documentation

void pqxx::dbtransaction::do_abort | ( |  | ) |
| protectedvirtual

Sensible default implemented here: abort backend transaction.

Default implementation does two things:

1. Clears the "connection reactivation avoidance counter"
2. Executes a ROLLBACK statement

Implements pqxx::transaction_base.

References pqxx::internal::sql_rollback_work.

void pqxx::dbtransaction::do_begin | ( |  | ) |
| protectedvirtual

Sensible default implemented here: begin backend transaction.

Implements pqxx::transaction_base.

virtual void pqxx::dbtransaction::do_commit | ( |  | ) |
| protectedpure virtual

To be implemented by derived class: commit backend transaction.

Implements pqxx::transaction_base.

pqxx::result pqxx::dbtransaction::do_exec | ( | const char | Query[] | ) |
| protectedvirtual

Sensible default implemented here: perform query.

Implements pqxx::transaction_base.

string pqxx::dbtransaction::fullname | ( | const std::string & | ttype,
|  | const std::string & | isolation
| ) |  |
| staticprotected

void pqxx::dbtransaction::start_backend_transaction | ( |  | ) |
| protected

Start a transaction on the backend and set desired isolation level.

The documentation for this class was generated from the following files:

- dbtransaction.hxx
- dbtransaction.cxx