libpqxx  4.0.1
subtransaction.hxx
1 /*-------------------------------------------------------------------------
2  *
3  * FILE
4  * pqxx/subtransaction.hxx
5  *
6  * DESCRIPTION
7  * definition of the pqxx::subtransaction class.
8  * pqxx::subtransaction is a nested transaction, i.e. one within a transaction
9  * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/subtransaction instead.
10  *
11  * Copyright (c) 2005-2011, 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_SUBTRANSACTION
20 #define PQXX_H_SUBTRANSACTION
21 
22 #include "pqxx/compiler-public.hxx"
23 #include "pqxx/compiler-internal-pre.hxx"
24 
25 #include "pqxx/dbtransaction"
26 
27 
28 
29 /* Methods tested in eg. self-test program test1 are marked with "//[t1]"
30  */
31 
32 
33 namespace pqxx
34 {
35 
39 
40 
86 class PQXX_LIBEXPORT subtransaction :
88  public dbtransaction
89 {
90 public:
92  explicit subtransaction( //[t88]
93  dbtransaction &T, const PGSTD::string &Name=PGSTD::string());
94 
96  explicit subtransaction(
97  subtransaction &T, const PGSTD::string &Name=PGSTD::string());
98 
99 private:
100  virtual void do_begin(); //[t88]
101  virtual void do_commit(); //[t88]
102  virtual void do_abort(); //[t88]
103 
104  void check_backendsupport() const;
105 
106  dbtransaction &m_parent;
107 };
108 
109 }
110 
111 
112 #include "pqxx/compiler-internal-post.hxx"
113 
114 #endif
115