9 #include "RelationalAccess/ISessionProxy.h"
10 #include "RelationalAccess/ITransaction.h"
14 namespace persistency {
32 return m_session->transaction().isActive();
64 oraSession.
open( coralSession, connectionString );
66 std::unique_ptr<IIOVSchema> iovSchemaHandle(
new OraIOVSchema( oraSession ) );
67 std::unique_ptr<IGTSchema> gtSchemaHandle(
new OraGTSchema( oraSession ) );
68 if( !iovSchemaHandle->exists() && !gtSchemaHandle->exists() ){
69 iovSchemaHandle.reset(
new IOVSchema( coralSession->nominalSchema() ) );
70 if( iovSchemaHandle->exists() ){
88 coralSession( session ),
89 connectionString( connectionStr ),
90 theBackendType( backType ){
126 throwException(
"No valid database found.",
"SessionImpl::startTransaction" );
129 if(!readOnly )
throwException(
"An update transaction is already active.",
130 "SessionImpl::startTransaction" );
158 if( !deep )
return true;
173 if( policy==
THROW)
throwException(
"IOV Database does not exist.",
"SessionImpl::openIovDb");
185 throwException(
"GT Database does not exist.",
"SessionImpl::openGTDb");
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)
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)