dbtransaction.hxx

00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/dbtransaction.hxx
00005  *
00006  *   DESCRIPTION
00007  *      definition of the pqxx::dbtransaction abstract base class.
00008  *   pqxx::dbransaction defines a real transaction on the database
00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/dbtransaction instead.
00010  *
00011  * Copyright (c) 2004-2015, 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_DBTRANSACTION
00020 #define PQXX_H_DBTRANSACTION
00021 
00022 #include "pqxx/compiler-public.hxx"
00023 #include "pqxx/compiler-internal-pre.hxx"
00024 
00025 #include "pqxx/transaction_base"
00026 
00027 namespace pqxx
00028 {
00029 
00030 enum readwrite_policy
00031 {
00032   read_only,
00033   read_write
00034 };
00035 
00036 
00038 
00068 class PQXX_LIBEXPORT PQXX_NOVTABLE dbtransaction : public transaction_base
00069 {
00070 public:
00071   virtual ~dbtransaction();
00072 
00073 protected:
00074   dbtransaction(
00075         connection_base &,
00076         const std::string &IsolationString,
00077         readwrite_policy rw=read_write);
00078 
00079   explicit dbtransaction(
00080         connection_base &,
00081         bool direct=true,
00082         readwrite_policy rw=read_write);
00083 
00084 
00086   void start_backend_transaction();
00087 
00089   virtual void do_begin();                                              //[t1]
00091   virtual result do_exec(const char Query[]);
00093   virtual void do_commit() =0;
00095 
00101   virtual void do_abort() PQXX_OVERRIDE;                                //[t13]
00102 
00103   static std::string fullname(const std::string &ttype,
00104         const std::string &isolation);
00105 
00106 private:
00108   std::string m_StartCmd;
00109 };
00110 
00111 
00112 } // namespace pqxx
00113 
00114 #include "pqxx/compiler-internal-post.hxx"
00115 
00116 #endif
00117 

Generated on 16 Mar 2017 for libpqxx by  doxygen 1.6.1