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

dbtransaction.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/dbtransaction.h
00005  *
00006  *   DESCRIPTION
00007  *      definition of the pqxx::dbtransaction abstract base class.
00008  *   pqxx::dbransaction defines a real transaction on the database
00009  *
00010  * Copyright (c) 2003, Jeroen T. Vermeulen <jtv@xs4all.nl>
00011  *
00012  * See COPYING for copyright license.  If you did not receive a file called
00013  * COPYING with this source code, please notify the distributor of this mistake,
00014  * or contact the author.
00015  *
00016  *-------------------------------------------------------------------------
00017  */
00018 #ifndef PQXX_DBTRANSACTION_H
00019 #define PQXX_DBTRANSACTION_H
00020 
00021 #include <string>
00022 
00023 #include "pqxx/transaction_base.h"
00024 
00025 namespace pqxx
00026 {
00027 
00029 
00034 class PQXX_LIBEXPORT dbtransaction : public transaction_base
00035 {
00036 protected:
00037   explicit dbtransaction(connection_base &C,
00038                          const PGSTD::string &IsolationString,
00039                          const PGSTD::string &NName) :                  //[]
00040     transaction_base(C, NName),
00041     m_StartCmd("START TRANSACTION ISOLATION LEVEL " + IsolationString)
00042   {}
00043 
00045   const PGSTD::string &StartCmd() const { return m_StartCmd; }
00046 
00047 private:
00049   virtual void DoBegin() =0;
00051   virtual result DoExec(const char Query[]) =0;
00053   virtual void DoCommit() =0;
00055   virtual void DoAbort() =0;
00056 
00058   PGSTD::string m_StartCmd;
00059 };
00060 
00062 template<> inline PGSTD::string Classname(const dbtransaction *) 
00063 { 
00064   return "dbtransaction"; 
00065 }
00066 
00067 }
00068 
00069 #endif
00070 

Generated on Sat Jun 7 00:49:33 2003 for libpqxx by doxygen1.3-rc3