CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::ScopedTransaction Class Reference

#include <ScopedTransaction.h>

Public Member Functions

bool commit ()
 Commits the transaction. More...
 
bool isActive (bool checkIfReadOnly=false) const
 Checks if the transaction is active. More...
 
bool rollback ()
 Rolls back the transaction. More...
 
 ScopedTransaction (Transaction &dbTransaction)
 
 ScopedTransaction (const ScopedTransaction &trans)
 
bool start (bool readOnly=true)
 Starts a new transaction. Returns the success of the operation. More...
 
virtual ~ScopedTransaction ()
 Default destructor. More...
 

Private Attributes

Transactionm_dbTransaction
 

Detailed Description

Definition at line 12 of file ScopedTransaction.h.

Constructor & Destructor Documentation

ora::ScopedTransaction::ScopedTransaction ( Transaction dbTransaction)
explicit

Definition at line 4 of file ScopedTransaction.cc.

4  :
5  m_dbTransaction( dbTransaction ){
6 }
Transaction & m_dbTransaction
ora::ScopedTransaction::ScopedTransaction ( const ScopedTransaction trans)

Definition at line 8 of file ScopedTransaction.cc.

8  :
9  m_dbTransaction( trans.m_dbTransaction ){
10 }
Transaction & m_dbTransaction
ora::ScopedTransaction::~ScopedTransaction ( )
virtual

Default destructor.

Definition at line 12 of file ScopedTransaction.cc.

12  {
13  if( m_dbTransaction.isActive() ) {
14  rollback();
15  }
16 }
bool isActive(bool checkIfReadOnly=false) const
Checks if the transaction is active.
Definition: Transaction.cc:42
Transaction & m_dbTransaction
bool rollback()
Rolls back the transaction.

Member Function Documentation

bool ora::ScopedTransaction::commit ( )

Commits the transaction.

Definition at line 22 of file ScopedTransaction.cc.

22  {
23  return m_dbTransaction.commit( );
24 }
bool commit()
Commits the transaction.
Definition: Transaction.cc:22
Transaction & m_dbTransaction
bool ora::ScopedTransaction::isActive ( bool  checkIfReadOnly = false) const

Checks if the transaction is active.

Definition at line 30 of file ScopedTransaction.cc.

30  {
31  return m_dbTransaction.isActive( checkIfReadOnly );
32 }
bool isActive(bool checkIfReadOnly=false) const
Checks if the transaction is active.
Definition: Transaction.cc:42
Transaction & m_dbTransaction
bool ora::ScopedTransaction::rollback ( )

Rolls back the transaction.

Definition at line 26 of file ScopedTransaction.cc.

26  {
27  return m_dbTransaction.rollback( );
28 }
bool rollback()
Rolls back the transaction.
Definition: Transaction.cc:32
Transaction & m_dbTransaction
bool ora::ScopedTransaction::start ( bool  readOnly = true)

Starts a new transaction. Returns the success of the operation.

Definition at line 18 of file ScopedTransaction.cc.

Referenced by progressbar.ProgressBar::__next__(), Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

18  {
19  return m_dbTransaction.start( readOnly );
20 }
bool start(bool readOnly=true)
Starts a new transaction. Returns the success of the operation.
Definition: Transaction.cc:12
Transaction & m_dbTransaction

Member Data Documentation

Transaction& ora::ScopedTransaction::m_dbTransaction
private

Definition at line 36 of file ScopedTransaction.h.