CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::DbTransaction Class Reference

#include <DbTransaction.h>

List of all members.

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::Transactionm_dbTrans
bool m_readOnly

Detailed Description

Definition at line 18 of file DbTransaction.h.


Constructor & Destructor Documentation

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();
}

Member Function Documentation

int DbTransaction::commit ( )
bool DbTransaction::forceCommit ( )

force the commit, regardless to the transaction clients

Definition at line 39 of file DbTransaction.cc.

                                   {
  bool doCommit = false;
  if(m_clients){
    m_dbTrans.commit();
    doCommit = true;
  }
  m_clients = 0;
  return doCommit;
}
int DbTransaction::isActive ( ) const

current transaction is active

Definition at line 59 of file DbTransaction.cc.

Referenced by cond::impl::IOVImpl::IOVImpl().

                                      {
  if(!m_dbTrans.isActive()) return 0;
  return m_clients;
}
bool DbTransaction::isReadOnly ( ) const

current transaction is readonly

Definition at line 64 of file DbTransaction.cc.

Referenced by cond::impl::IOVImpl::IOVImpl().

{
  return m_dbTrans.isActive( true );
}
bool DbTransaction::rollback ( )

rollback transaction

Definition at line 49 of file DbTransaction.cc.

                                {
  bool doRollBack = false;
  if(m_clients){
    m_dbTrans.rollback();
    doRollBack = true;
  }
  m_clients = 0;
  return doRollBack;
}
int DbTransaction::start ( bool  readOnly = false)

Member Data Documentation

Definition at line 39 of file DbTransaction.h.

Definition at line 37 of file DbTransaction.h.

Definition at line 38 of file DbTransaction.h.