Public Member Functions | |
void | close () |
void | open (const std::string &connectionString, const std::string &role, bool readOnly) |
SessionImpl (const DbConnection &connection) | |
SessionImpl () | |
virtual | ~SessionImpl () |
Public Attributes | |
std::string const | blobStreamingService |
std::auto_ptr< DbConnection > | connection |
std::auto_ptr< ora::Database > | database |
bool | isOpen |
std::auto_ptr < cond::TechnologyProxy > | technologyProxy |
std::auto_ptr< DbTransaction > | transaction |
Definition at line 34 of file DbSession.cc.
cond::SessionImpl::SessionImpl | ( | ) | [inline] |
Definition at line 36 of file DbSession.cc.
: connection(), blobStreamingService( "COND/Services/BlobStreamingService" ), database(), transaction(), isOpen(false){ }
cond::SessionImpl::SessionImpl | ( | const DbConnection & | connection | ) | [inline, explicit] |
Definition at line 44 of file DbSession.cc.
: connection(new DbConnection(connection)), blobStreamingService( "COND/Services/BlobStreamingService" ), database(), transaction(), isOpen(false){ }
virtual cond::SessionImpl::~SessionImpl | ( | ) | [inline, virtual] |
void cond::SessionImpl::close | ( | void | ) | [inline] |
Definition at line 82 of file DbSession.cc.
References database, isOpen, and transaction.
Referenced by open(), and ~SessionImpl().
{ transaction.reset(); database.reset(); isOpen = false; }
void cond::SessionImpl::open | ( | const std::string & | connectionString, |
const std::string & | role, | ||
bool | readOnly | ||
) | [inline] |
Definition at line 57 of file DbSession.cc.
References ora::Configuration::automaticContainerCreation(), blobStreamingService, cond::buildTechnologyProxy(), close(), connection, database, Exception, reco::get(), isOpen, technologyProxy, and transaction.
{ close(); if( connection.get() ){ if(!connection->isOpen()){ throw cond::Exception("DbSession::open: cannot open session. Underlying connection is closed."); } boost::shared_ptr<ora::ConnectionPool> connPool = connection->connectionPool(); database.reset( new ora::Database( connPool ) ); ora::IBlobStreamingService* blobStreamer = cond::BlobStreamerPluginFactory::get()->create( blobStreamingService ); if(!blobStreamer) throw cond::Exception("DbSession::open: cannot find required plugin. No instance of ora::IBlobStreamingService has been loaded.."); database->configuration().setBlobStreamingService( blobStreamer ); //database->configuration().properties().setFlag( ora::Configuration::automaticDatabaseCreation() ); database->configuration().properties().setFlag( ora::Configuration::automaticContainerCreation() ); // open the db connection technologyProxy = buildTechnologyProxy(connectionString, *connection); std::string connStr = (*technologyProxy).getRealConnectString(); database->connect( connStr, role, readOnly ); transaction.reset( new cond::DbTransaction( database->transaction() ) ); isOpen = true; } }
std::string const cond::SessionImpl::blobStreamingService |
Definition at line 90 of file DbSession.cc.
Referenced by open().
std::auto_ptr<DbConnection> cond::SessionImpl::connection |
Definition at line 88 of file DbSession.cc.
Referenced by open().
std::auto_ptr<ora::Database> cond::SessionImpl::database |
Definition at line 91 of file DbSession.cc.
Definition at line 93 of file DbSession.cc.
std::auto_ptr<cond::TechnologyProxy> cond::SessionImpl::technologyProxy |
Definition at line 89 of file DbSession.cc.
Referenced by open().
std::auto_ptr<DbTransaction> cond::SessionImpl::transaction |
Definition at line 92 of file DbSession.cc.