dbtransaction.hxx

Go to the documentation of this file.
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-2009, 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 
00073 class PQXX_LIBEXPORT PQXX_NOVTABLE dbtransaction : public transaction_base
00074 {
00075 public:
00076   virtual ~dbtransaction();
00077 
00078 protected:
00079   dbtransaction(
00080         connection_base &,
00081         const PGSTD::string &IsolationString,
00082         readwrite_policy rw=read_write);
00083 
00084   explicit dbtransaction(
00085         connection_base &,
00086         bool direct=true,
00087         readwrite_policy rw=read_write);
00088 
00089 
00091   void start_backend_transaction();
00092 
00094   virtual void do_begin();                                              //[t1]
00096   virtual result do_exec(const char Query[]);
00098   virtual void do_commit() =0;
00100 
00106   virtual void do_abort();                                              //[t13]
00107 
00108   static PGSTD::string fullname(const PGSTD::string &ttype,
00109         const PGSTD::string &isolation);
00110 
00111 private:
00113   PGSTD::string m_StartCmd;
00114 };
00115 
00116 
00117 } // namespace pqxx
00118 
00119 #include "pqxx/compiler-internal-post.hxx"
00120 
00121 #endif
00122 

Generated on Mon Feb 15 18:22:41 2010 for libpqxx by  doxygen 1.5.5