00001 #ifndef INCLUDE_ORA_SCOPEDTRANSACTION_H 00002 #define INCLUDE_ORA_SCOPEDTRANSACTION_H 00003 00004 namespace ora { 00005 00006 class Transaction; 00007 00012 class ScopedTransaction { 00013 00014 public: 00015 explicit ScopedTransaction( Transaction& dbTransaction ); 00016 00018 ScopedTransaction( const ScopedTransaction& trans ); 00019 00021 virtual ~ScopedTransaction(); 00022 00024 bool start( bool readOnly=true ); 00025 00027 bool commit(); 00028 00030 bool rollback(); 00031 00033 bool isActive( bool checkIfReadOnly=false ) const; 00034 00035 private: 00036 Transaction& m_dbTransaction; 00037 }; 00038 00039 } 00040 00041 #endif 00042