libpqxx 4.0.1

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

dbtransaction.hxx
1 /*-------------------------------------------------------------------------
2 *
3 * FILE
4 * pqxx/dbtransaction.hxx
5 *
6 * DESCRIPTION
7 * definition of the pqxx::dbtransaction abstract base class.
8 * pqxx::dbransaction defines a real transaction on the database
9 * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/dbtransaction instead.
10 *
11 * Copyright (c) 2004-2009, Jeroen T. Vermeulen <jtv@xs4all.nl>
12 *
13 * See COPYING for copyright license. If you did not receive a file called
14 * COPYING with this source code, please notify the distributor of this mistake,
15 * or contact the author.
16 *
17 *-------------------------------------------------------------------------
18 */
19 #ifndef PQXX_H_DBTRANSACTION
20 #define PQXX_H_DBTRANSACTION
21
22 #include "pqxx/compiler-public.hxx"
23 #include "pqxx/compiler-internal-pre.hxx"
24
25 #include "pqxx/transaction_base"
26
27 namespace pqxx
28 {
29
30 enum readwrite_policy
31 {
32 read_only,
33 read_write
34 };
35
36
38
73 class PQXX_LIBEXPORT PQXX_NOVTABLE dbtransaction : public transaction_base
74 {
75 public:
76 virtual ~dbtransaction();
77
78 protected:
79 dbtransaction(
80 connection_base &,
81 const PGSTD::string &IsolationString,
82 readwrite_policy rw=read_write);
83
84 explicit dbtransaction(
85 connection_base &,
86 bool direct=true,
87 readwrite_policy rw=read_write);
88
89
91 void start_backend_transaction();
92
94 virtual void do_begin(); //[t1]
96 virtual result do_exec(const char Query[]);
98 virtual void do_commit() =0;
100
106 virtual void do_abort(); //[t13]
107
108 static PGSTD::string fullname(const PGSTD::string &ttype,
109 const PGSTD::string &isolation);
110
111 private:
113 PGSTD::string m_StartCmd;
114 };
115
116
117 } // namespace pqxx
118
119 #include "pqxx/compiler-internal-post.hxx"
120
121 #endif
122