#include <DbTransaction.h>
Public Member Functions | |
int | commit () |
commit transaction. | |
DbTransaction (ora::Transaction &dbTrans) | |
bool | forceCommit () |
force the commit, regardless to the transaction clients | |
int | isActive () const |
current transaction is active | |
bool | isReadOnly () const |
current transaction is readonly | |
bool | rollback () |
rollback transaction | |
int | start (bool readOnly=false) |
start transaction | |
~DbTransaction () | |
Private Attributes | |
int | m_clients |
ora::Transaction & | m_dbTrans |
bool | m_readOnly |
Definition at line 19 of file DbTransaction.h.
DbTransaction::DbTransaction | ( | ora::Transaction & | dbTrans | ) |
Definition at line 8 of file DbTransaction.cc.
: m_dbTrans( dbTrans ),m_readOnly(true),m_clients(0){ }
DbTransaction::~DbTransaction | ( | ) |
Definition at line 12 of file DbTransaction.cc.
{ rollback(); }
int DbTransaction::commit | ( | ) |
commit transaction.
Definition at line 28 of file DbTransaction.cc.
Referenced by cond::BasePayloadProxy::BasePayloadProxy(), cond::CondDB::commitTransaction(), cond::ExportIOVUtilities::execute(), cond::RDBMS::globalTag(), cond::KeyList::load(), cond::BasePayloadProxy::loadIov(), cond::BasePayloadProxy::loadTag(), cond::BasePayloadProxy::make(), and cond::BasePayloadProxy::refresh().
bool DbTransaction::forceCommit | ( | ) |
int DbTransaction::isActive | ( | ) | const |
current transaction is active
Definition at line 59 of file DbTransaction.cc.
bool DbTransaction::isReadOnly | ( | ) | const |
current transaction is readonly
Definition at line 64 of file DbTransaction.cc.
bool DbTransaction::rollback | ( | ) |
int DbTransaction::start | ( | bool | readOnly = false | ) |
start transaction
Definition at line 16 of file DbTransaction.cc.
Referenced by cond::BasePayloadProxy::BasePayloadProxy(), cond::ExportIOVUtilities::execute(), cond::AlignSplitIOV::execute(), cond::RDBMS::globalTag(), cond::KeyList::load(), cond::BasePayloadProxy::loadIov(), cond::BasePayloadProxy::loadTag(), cond::BasePayloadProxy::make(), cond::PayLoadInspector< DataT >::plot(), cond::BasePayloadProxy::refresh(), cond::CondDB::startReadOnlyTransaction(), cond::CondDB::startTransaction(), cond::PayLoadInspector< DataT >::summary(), and cond::PayLoadInspector< DataT >::trend_plot().
{ if(!m_clients){ m_dbTrans.start( readOnly ); m_readOnly = readOnly; } else { if(readOnly != m_readOnly) return -1; } ++m_clients; return m_clients; }
int cond::DbTransaction::m_clients [private] |
Definition at line 40 of file DbTransaction.h.
ora::Transaction& cond::DbTransaction::m_dbTrans [private] |
Definition at line 38 of file DbTransaction.h.
bool cond::DbTransaction::m_readOnly [private] |
Definition at line 39 of file DbTransaction.h.