CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ScopedTransaction.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_SCOPEDTRANSACTION_H
2 #define INCLUDE_ORA_SCOPEDTRANSACTION_H
3 
4 namespace ora {
5 
6  class Transaction;
7 
13 
14  public:
15  explicit ScopedTransaction( Transaction& dbTransaction );
16 
18  ScopedTransaction( const ScopedTransaction& trans );
19 
21  virtual ~ScopedTransaction();
22 
24  bool start( bool readOnly=true );
25 
27  bool commit();
28 
30  bool rollback();
31 
33  bool isActive( bool checkIfReadOnly=false ) const;
34 
35  private:
37  };
38 
39 }
40 
41 #endif
42 
bool start(bool readOnly=true)
Starts a new transaction. Returns the success of the operation.
ScopedTransaction(Transaction &dbTransaction)
bool commit()
Commits the transaction.
bool isActive(bool checkIfReadOnly=false) const
Checks if the transaction is active.
Transaction & m_dbTransaction
virtual ~ScopedTransaction()
Default destructor.
bool rollback()
Rolls back the transaction.