test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ScopedTransaction.cc
Go to the documentation of this file.
3 
5  m_dbTransaction( dbTransaction ){
6 }
7 
9  m_dbTransaction( trans.m_dbTransaction ){
10 }
11 
13  if( m_dbTransaction.isActive() ) {
14  rollback();
15  }
16 }
17 
18 bool ora::ScopedTransaction::start( bool readOnly ){
19  return m_dbTransaction.start( readOnly );
20 }
21 
23  return m_dbTransaction.commit( );
24 }
25 
27  return m_dbTransaction.rollback( );
28 }
29 
30 bool ora::ScopedTransaction::isActive( bool checkIfReadOnly ) const {
31  return m_dbTransaction.isActive( checkIfReadOnly );
32 }
33 
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.
virtual ~ScopedTransaction()
Default destructor.
bool rollback()
Rolls back the transaction.