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
00036
00037 class PQXX_LIBEXPORT basic_robusttransaction : public dbtransaction
00038 {
00039 public:
00041 typedef isolation_traits<read_committed> isolation_tag;
00042
00043 virtual ~basic_robusttransaction() =0;
00044
00045 protected:
00046 basic_robusttransaction(connection_base &C,
00047 const PGSTD::string &IsolationLevel);
00048
00049 private:
00050 typedef unsigned long IDType;
00051 IDType m_ID;
00052 PGSTD::string m_LogTable;
00053 int m_backendpid;
00054
00055 virtual void do_begin();
00056 virtual void do_commit();
00057 virtual void do_abort();
00058
00059 void PQXX_PRIVATE CreateLogTable();
00060 void PQXX_PRIVATE CreateTransactionRecord();
00061 void PQXX_PRIVATE DeleteTransactionRecord(IDType ID) throw ();
00062 bool PQXX_PRIVATE CheckTransactionRecord(IDType ID);
00063 };
00064
00065
00066
00068
00134 template<isolation_level ISOLATIONLEVEL=read_committed>
00135 class robusttransaction : public basic_robusttransaction
00136 {
00137 public:
00138 typedef isolation_traits<ISOLATIONLEVEL> isolation_tag;
00139
00141
00145 explicit robusttransaction(connection_base &C,
00146 const PGSTD::string &Name=PGSTD::string()) :
00147 namedclass(fullname("robusttransaction",isolation_tag::name()), Name),
00148 basic_robusttransaction(C, isolation_tag::name())
00149 { Begin(); }
00150
00151 virtual ~robusttransaction() throw ()
00152 {
00153 #ifdef PQXX_QUIET_DESTRUCTORS
00154 internal::disable_noticer Quiet(conn());
00155 #endif
00156 End();
00157 }
00158 };
00159
00161
00162 }
00163
00164
00165 #include "pqxx/compiler-internal-post.hxx"