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/connectionitf.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:
00101 
00105   explicit RobustTransaction(ConnectionItf &C,
00106                              const PGSTD::string &Name=PGSTD::string());
00107 
00108   virtual ~RobustTransaction();                                         
00109 
00110 private:
00111   typedef unsigned long IDType;
00112   IDType m_ID;
00113   PGSTD::string m_LogTable;
00114 
00115   virtual void DoBegin();                                               
00116   virtual Result DoExec(const char[]);                                  
00117   virtual void DoCommit();                                              
00118   virtual void DoAbort();                                               
00119 
00120   void CreateLogTable();
00121   void CreateTransactionRecord();
00122   void DeleteTransactionRecord(IDType ID) throw ();
00123   bool CheckTransactionRecord(IDType ID);
00124 };
00125 
00126 
00127 }
00128 
00129 
00130 #endif
00131