Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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) 2003, 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 #include <string>
00020 
00021 #include "pqxx/transaction_base"
00022 
00023 namespace pqxx
00024 {
00025 
00027 
00054 class PQXX_LIBEXPORT dbtransaction : public transaction_base
00055 {
00056 protected:
00057   explicit dbtransaction(connection_base &C,
00058                          const PGSTD::string &IsolationString,
00059                          const PGSTD::string &NName) :
00060     transaction_base(C, NName),
00061     m_StartCmd("START TRANSACTION ISOLATION LEVEL " + IsolationString)
00062   {}
00063 
00064 #ifdef PQXX_DEPRECATED_HEADERS
00065 
00066   const PGSTD::string &StartCmd() const { return startcommand(); }
00067 #endif
00068 
00070   const PGSTD::string &startcommand() const { return m_StartCmd; }
00071 
00072 private:
00073 
00075   virtual void do_begin() =0;
00077   virtual result do_exec(const char Query[]) =0;
00079   virtual void do_commit() =0;
00081   virtual void do_abort() =0;
00082 
00084   PGSTD::string m_StartCmd;
00085 };
00086 
00088 template<> inline PGSTD::string Classname(const dbtransaction *) 
00089 { 
00090   return "dbtransaction"; 
00091 }
00092 
00093 }
00094 

Generated on Sat Nov 15 01:48:58 2003 for libpqxx by doxygen 1.3.4