CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CondCore/DBCommon/interface/DbScopedTransaction.h

Go to the documentation of this file.
00001 #ifndef CondCore_DBCommon_DbScopedTransaction_H
00002 #define CondCore_DBCommon_DbScopedTransaction_H
00003 //
00004 // Package:     DBCommon
00005 // Class  :     DbScopedTransaction
00006 // 
00010 //
00011 //
00012 
00013 namespace cond{
00014 
00015   class DbSession;
00016   
00017   class DbScopedTransaction {
00018   public:
00019     explicit DbScopedTransaction( cond::DbSession& session );   
00020     
00021     ~DbScopedTransaction();
00023     int start(bool readOnly = false);
00025     int commit();
00027     bool rollback();
00029     bool isLocallyActive() const;
00031     int isActive() const;
00033     bool isReadOnly() const;
00034   private:
00035     cond::DbSession& m_session;
00036     bool m_locallyActive;
00037     
00038   };
00039 }
00040 #endif