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

robusttransaction.hxx

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------- 00002 * 00003 * FILE 00004 * pqxx/robusttransaction.hxx 00005 * 00006 * DESCRIPTION 00007 * definition of the pqxx::robusttransaction class. 00008 * pqxx::robusttransaction is a slower but safer transaction class 00009 * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/robusttransaction instead. 00010 * 00011 * Copyright (c) 2002-2004, 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 "pqxx/dbtransaction" 00020 00021 00022 /* Methods tested in eg. self-test program test001 are marked with "//[t1]" 00023 */ 00024 00025 00026 namespace pqxx 00027 { 00028 00029 class PQXX_LIBEXPORT basic_robusttransaction : public dbtransaction 00030 { 00031 public: 00033 typedef isolation_traits<read_committed> isolation_tag; 00034 00035 virtual ~basic_robusttransaction() =0; //[t16] 00036 00037 protected: 00039 00044 explicit basic_robusttransaction(connection_base &C, 00045 const PGSTD::string &IsolationLevel, 00046 const PGSTD::string &Name); //[t16] 00047 00048 private: 00049 typedef unsigned long IDType; 00050 IDType m_ID; 00051 PGSTD::string m_LogTable; 00052 00053 virtual void do_begin(); //[t18] 00054 virtual void do_commit(); //[t16] 00055 virtual void do_abort(); //[t18] 00056 00057 void CreateLogTable(); 00058 void CreateTransactionRecord(); 00059 void DeleteTransactionRecord(IDType ID) throw (); 00060 bool CheckTransactionRecord(IDType ID); 00061 }; 00062 00063 00064 00066 00133 template<isolation_level ISOLATIONLEVEL=read_committed> 00134 class robusttransaction : public basic_robusttransaction 00135 { 00136 public: 00137 typedef isolation_traits<ISOLATIONLEVEL> isolation_tag; 00138 00139 explicit robusttransaction(connection_base &C, 00140 const PGSTD::string &TName=PGSTD::string()) : 00141 basic_robusttransaction(C, isolation_tag::name(), TName) 00142 { Begin(); } 00143 00144 virtual ~robusttransaction() throw () { End(); } 00145 }; 00146 00147 } // namespace pqxx 00148 00149

Generated on Thu Jun 17 18:47:09 2004 for libpqxx by doxygen 1.3.7