dbtransaction.hxx
#ifndef PQXX_H_DBTRANSACTION
#define PQXX_H_DBTRANSACTION
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
#include "pqxx/transaction_base.hxx"
namespace pqxx
{
enum readwrite_policy
{
read_only,
read_write
};
class PQXX_LIBEXPORT PQXX_NOVTABLE dbtransaction : public transaction_base
{
public:
virtual ~dbtransaction();
protected:
dbtransaction(
connection_base &,
const std::string &IsolationString,
readwrite_policy rw=read_write);
explicit dbtransaction(
connection_base &,
bool direct=true,
readwrite_policy rw=read_write);
void start_backend_transaction();
virtual void do_begin() override; //[t01]
virtual result do_exec(const char Query[]) override;
virtual void do_commit() override =0;
virtual void do_abort() override; //[t13]
static std::string fullname(const std::string &ttype,
const std::string &isolation);
private:
std::string m_start_cmd;
};
} // namespace pqxx
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::internal
Private namespace for libpqxx's internal use; do not access.
Definition: connection_base.hxx:43
pqxx::dbtransaction::~dbtransaction
virtual ~dbtransaction()
Definition: dbtransaction.cxx:61
pqxx::result
Result set containing data returned by a query or command.
Definition: result.hxx:69
pqxx::dbtransaction::do_exec
virtual result do_exec(const char Query[]) override
Sensible default implemented here: perform query.
Definition: dbtransaction.cxx:74
pqxx::read_only
@ read_only
Definition: dbtransaction.hxx:26
pqxx::dbtransaction::do_abort
virtual void do_abort() override
Sensible default implemented here: abort backend transaction.
Definition: dbtransaction.cxx:88
pqxx::readwrite_policy
readwrite_policy
Definition: dbtransaction.hxx:24
pqxx::dbtransaction::do_begin
virtual void do_begin() override
Sensible default implemented here: begin backend transaction.
Definition: dbtransaction.cxx:66
pqxx::dbtransaction::fullname
static std::string fullname(const std::string &ttype, const std::string &isolation)
Definition: dbtransaction.cxx:95
pqxx::internal::namedclass
Helper base class: object descriptions for error messages and such.
Definition: util.hxx:233
pqxx::dbtransaction::dbtransaction
dbtransaction(connection_base &, const std::string &IsolationString, readwrite_policy rw=read_write)
Definition: dbtransaction.cxx:39
pqxx::connection_base
connection_base abstract base class; represents a connection to a database.
Definition: connection_base.hxx:139
pqxx::dbtransaction
Abstract base class responsible for bracketing a backend transaction.
Definition: dbtransaction.hxx:62
pqxx::transaction_base
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:136
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
pqxx::read_write
@ read_write
Definition: dbtransaction.hxx:27
pqxx::isolation_traits
Traits class to describe an isolation level; primarly for libpqxx's own use.
Definition: isolation.hxx:65