test
CMS 3D CMS Logo

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