#include <ScopedTransaction.h>
Public Member Functions | |
bool | commit () |
Commits the transaction. | |
bool | isActive (bool checkIfReadOnly=false) const |
Checks if the transaction is active. | |
bool | rollback () |
Rolls back the transaction. | |
ScopedTransaction (const ScopedTransaction &trans) | |
ScopedTransaction (Transaction &dbTransaction) | |
bool | start (bool readOnly=true) |
Starts a new transaction. Returns the success of the operation. | |
virtual | ~ScopedTransaction () |
Default destructor. | |
Private Attributes | |
Transaction & | m_dbTransaction |
Definition at line 12 of file ScopedTransaction.h.
ora::ScopedTransaction::ScopedTransaction | ( | Transaction & | dbTransaction | ) | [explicit] |
Definition at line 4 of file ScopedTransaction.cc.
: m_dbTransaction( dbTransaction ){ }
ora::ScopedTransaction::ScopedTransaction | ( | const ScopedTransaction & | trans | ) |
Definition at line 8 of file ScopedTransaction.cc.
: m_dbTransaction( trans.m_dbTransaction ){ }
ora::ScopedTransaction::~ScopedTransaction | ( | ) | [virtual] |
Default destructor.
Definition at line 12 of file ScopedTransaction.cc.
{ if( m_dbTransaction.isActive() ) { rollback(); } }
bool ora::ScopedTransaction::commit | ( | ) |
Commits the transaction.
Definition at line 22 of file ScopedTransaction.cc.
{ return m_dbTransaction.commit( ); }
bool ora::ScopedTransaction::isActive | ( | bool | checkIfReadOnly = false | ) | const |
Checks if the transaction is active.
Definition at line 30 of file ScopedTransaction.cc.
{ return m_dbTransaction.isActive( checkIfReadOnly ); }
bool ora::ScopedTransaction::rollback | ( | ) |
Rolls back the transaction.
Definition at line 26 of file ScopedTransaction.cc.
{ return m_dbTransaction.rollback( ); }
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.
{ return m_dbTransaction.start( readOnly ); }
Definition at line 36 of file ScopedTransaction.h.