00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pqxx/compiler-public.hxx"
00020 #include "pqxx/compiler-internal-pre.hxx"
00021
00022 #include "pqxx/dbtransaction"
00023
00024
00025
00026
00027
00028
00029 namespace pqxx
00030 {
00031
00038 class PQXX_LIBEXPORT basic_robusttransaction : public dbtransaction
00039 {
00040 public:
00042 typedef isolation_traits<read_committed> isolation_tag;
00043
00044 virtual ~basic_robusttransaction() =0;
00045
00046 protected:
00047 basic_robusttransaction(connection_base &C,
00048 const PGSTD::string &IsolationLevel);
00049
00050 private:
00051 typedef unsigned long IDType;
00052 IDType m_ID;
00053 PGSTD::string m_LogTable;
00054 int m_backendpid;
00055
00056 virtual void do_begin();
00057 virtual void do_commit();
00058 virtual void do_abort();
00059
00060 void PQXX_PRIVATE CreateLogTable();
00061 void PQXX_PRIVATE CreateTransactionRecord();
00062 void PQXX_PRIVATE DeleteTransactionRecord(IDType ID) throw ();
00063 bool PQXX_PRIVATE CheckTransactionRecord(IDType ID);
00064 };
00065
00066
00067
00069
00135 template<isolation_level ISOLATIONLEVEL=read_committed>
00136 class robusttransaction : public basic_robusttransaction
00137 {
00138 public:
00139 typedef isolation_traits<ISOLATIONLEVEL> isolation_tag;
00140
00142
00146 explicit robusttransaction(connection_base &C,
00147 const PGSTD::string &Name=PGSTD::string()) :
00148 namedclass(fullname("robusttransaction",isolation_tag::name()), Name),
00149 basic_robusttransaction(C, isolation_tag::name())
00150 { Begin(); }
00151
00152 virtual ~robusttransaction() throw ()
00153 {
00154 #ifdef PQXX_QUIET_DESTRUCTORS
00155 internal::disable_noticer Quiet(conn());
00156 #endif
00157 End();
00158 }
00159 };
00160
00165 }
00166
00167
00168 #include "pqxx/compiler-internal-post.hxx"