#include <Transaction.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. | |
bool | start (bool readOnly=true) |
Starts a new transaction. Returns the success of the operation. | |
Transaction (DatabaseSession &session) | |
virtual | ~Transaction () |
Default destructor. | |
Private Attributes | |
bool | m_localActive |
DatabaseSession & | m_session |
Definition at line 12 of file Transaction.h.
ora::Transaction::Transaction | ( | DatabaseSession & | session | ) | [explicit] |
Definition at line 4 of file Transaction.cc.
: m_session( session ), m_localActive( false ){ }
ora::Transaction::~Transaction | ( | ) | [virtual] |
bool ora::Transaction::commit | ( | ) |
Commits the transaction.
Definition at line 22 of file Transaction.cc.
{ bool committed = false; if(m_localActive){ m_session.commitTransaction(); m_localActive = false; committed = true; } return committed; }
bool ora::Transaction::isActive | ( | bool | checkIfReadOnly = false | ) | const |
Checks if the transaction is active.
Definition at line 42 of file Transaction.cc.
bool ora::Transaction::rollback | ( | ) |
Rolls back the transaction.
Definition at line 32 of file Transaction.cc.
{ bool rolled = false; if(m_localActive){ m_session.rollbackTransaction(); m_localActive = false; rolled = true; } return rolled; }
bool ora::Transaction::start | ( | bool | readOnly = true | ) |
Starts a new transaction. Returns the success of the operation.
Definition at line 12 of file Transaction.cc.
{ bool started = false; if(!m_localActive){ m_session.startTransaction( readOnly ); m_localActive = true; started = true; } return started; }
bool ora::Transaction::m_localActive [private] |
Definition at line 34 of file Transaction.h.
DatabaseSession& ora::Transaction::m_session [private] |
Definition at line 33 of file Transaction.h.