00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef PQXX_ROBUSTTRANSACTION_H
00015 #define PQXX_ROBUSTTRANSACTION_H
00016 
00017 
00018 #include "pqxx/connection.h"
00019 #include "pqxx/transactionitf.h"
00020 
00021 
00022 
00023 
00024 
00025 
00026 namespace pqxx
00027 {
00028 
00030 
00097 class PQXX_LIBEXPORT RobustTransaction : public TransactionItf
00098 {
00099 public:
00100   explicit RobustTransaction(Connection &, 
00101                              PGSTD::string Name=PGSTD::string());       
00102 
00103   virtual ~RobustTransaction();                                         
00104 
00105 private:
00106   typedef unsigned long IDType;
00107   IDType m_ID;
00108   PGSTD::string m_LogTable;
00109 
00110   virtual void DoBegin();                                               
00111   virtual Result DoExec(const char[]);                                  
00112   virtual void DoCommit();                                              
00113   virtual void DoAbort();                                               
00114 
00115   void CreateLogTable();
00116   void CreateTransactionRecord();
00117   void DeleteTransactionRecord(IDType ID) throw ();
00118   bool CheckTransactionRecord(IDType ID);
00119 };
00120 
00121 
00122 }
00123 
00124 
00125 #endif
00126