libpqxx 4.0
subtransaction.hxx
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/subtransaction.hxx
00005  *
00006  *   DESCRIPTION
00007  *      definition of the pqxx::subtransaction class.
00008  *   pqxx::subtransaction is a nested transaction, i.e. one within a transaction
00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/subtransaction instead.
00010  *
00011  * Copyright (c) 2005-2011, Jeroen T. Vermeulen <jtv@xs4all.nl>
00012  *
00013  * See COPYING for copyright license.  If you did not receive a file called
00014  * COPYING with this source code, please notify the distributor of this mistake,
00015  * or contact the author.
00016  *
00017  *-------------------------------------------------------------------------
00018  */
00019 #ifndef PQXX_H_SUBTRANSACTION
00020 #define PQXX_H_SUBTRANSACTION
00021 
00022 #include "pqxx/compiler-public.hxx"
00023 #include "pqxx/compiler-internal-pre.hxx"
00024 
00025 #include "pqxx/dbtransaction"
00026 
00027 
00028 
00029 /* Methods tested in eg. self-test program test1 are marked with "//[t1]"
00030  */
00031 
00032 
00033 namespace pqxx
00034 {
00035 
00039 
00040 
00086 class PQXX_LIBEXPORT subtransaction :
00087   public internal::transactionfocus,
00088   public dbtransaction
00089 {
00090 public:
00092   explicit subtransaction(                                              //[t88]
00093         dbtransaction &T, const PGSTD::string &Name=PGSTD::string());
00094 
00096   explicit subtransaction(
00097         subtransaction &T, const PGSTD::string &Name=PGSTD::string());
00098 
00099 private:
00100   virtual void do_begin();                                              //[t88]
00101   virtual void do_commit();                                             //[t88]
00102   virtual void do_abort();                                              //[t88]
00103 
00104   void check_backendsupport() const;
00105 
00106   dbtransaction &m_parent;
00107 };
00108 
00109 }
00110 
00111 
00112 #include "pqxx/compiler-internal-post.hxx"
00113 
00114 #endif
00115