12 #include "RelationalAccess/ISessionProxy.h"
13 #include "RelationalAccess/ITransaction.h"
17 namespace persistency {
35 return m_session->transaction().isActive();
67 oraSession.
open( coralSession, connectionString );
69 std::unique_ptr<IIOVSchema> iovSchemaHandle(
new OraIOVSchema( oraSession ) );
70 std::unique_ptr<IGTSchema> gtSchemaHandle(
new OraGTSchema( oraSession ) );
71 if( !iovSchemaHandle->exists() && !gtSchemaHandle->exists() ){
72 iovSchemaHandle.reset(
new IOVSchema( coralSession->nominalSchema() ) );
89 coralSession( session ),
91 theBackendType( backType ){
127 throwException(
"No valid database found.",
"SessionImpl::startTransaction" );
130 if(!readOnly )
throwException(
"An update transaction is already active.",
131 "SessionImpl::startTransaction" );
159 if( !deep )
return true;
174 if( policy==
THROW)
throwException(
"IOV Database does not exist.",
"SessionImpl::openIovDb");
BackendType checkBackendType(boost::shared_ptr< coral::ISessionProxy > &coralSession, const std::string &connectionString)
bool rollback()
rollback transaction
OraTransaction(const cond::DbSession &session)
DbTransaction & transaction()
BackendType theBackendType
int isActive() const
current transaction is active
void open(const std::string &connectionString, bool readOnly=false)
void openGTDb(FailureOnOpeningPolicy policy=THROW)
int commit()
commit transaction.
virtual ~OraTransaction()
std::string connectionString
void openIovDb(FailureOnOpeningPolicy policy=THROW)
std::unique_ptr< IIOVSchema > iovSchemaHandle
cond::DbSession m_session
int start(bool readOnly=false)
start transaction
CondDBTransaction(const boost::shared_ptr< coral::ISessionProxy > &coralSession)
virtual ~CondDBTransaction()
boost::shared_ptr< coral::ISessionProxy > m_session
boost::shared_ptr< coral::ISessionProxy > coralSession
std::unique_ptr< IGTSchema > gtSchemaHandle
void startTransaction(bool readOnly=true)
bool isTransactionActive(bool deep=true) const
void rollbackTransaction()
std::unique_ptr< ITransaction > transaction
void throwException(const std::string &message, const std::string &methodName)