8#include "GaudiKernel/MsgStream.h"
10#include "CoolApplication/DatabaseSvcFactory.h"
11#include "CoolKernel/IDatabaseSvc.h"
13#include "RelationalAccess/ConnectionService.h"
36 m_log << MSG::ERROR <<
"COOL connection for " <<
m_connstr <<
" already aborted as invalid" <<
endmsg;
44 cool::IDatabaseSvc& dbSvc = cool::DatabaseSvcFactory::databaseService();
48 }
catch (std::exception& e) {
51 m_log << MSG::INFO <<
"*** COOL exception caught: " << e.what() <<
endmsg;
56 }
catch (std::exception& e) {
57 m_log << MSG::ERROR <<
"*** COOL exception caught: " << e.what() <<
endmsg;
58 m_log << MSG::ERROR <<
"Could not create a new conditions database - abort connection" <<
endmsg;
63 m_log << MSG::ERROR <<
"*** COOL exception caught: " << e.what() <<
endmsg;
64 m_log << MSG::ERROR <<
"*** Cannot open database connection [" <<
m_connstr <<
"] in " << (
m_readonly ?
"readonly" :
"writing") <<
" mode - abort connection" <<
endmsg;
90 }
catch (std::exception& e) {
91 m_log << MSG::WARNING <<
"Exception from disconnect/reconnect: " <<e.what() <<
endmsg;
95 }
catch (std::exception& e) {
96 m_log << MSG::ERROR <<
"Cannot reconnect to database:" << e.what()<<
endmsg;
107 coral::ConnectionService connSvc;
119 }
catch (std::exception& e) {
120 m_log << MSG::INFO <<
"Exception caught when disconnecting: " <<e.what() <<
endmsg;
128 }
catch (std::exception& e) {
129 m_log << MSG::INFO <<
"Exception caught when disconnecting CoraCool: "<< e.what() <<
endmsg;
145 m_log << MSG::INFO <<
"Connection " <<
m_connstr <<
" : nConnect: " <<
147 std::setw(8) << std::setprecision(2) << fread <<
" ))s" <<
endmsg;
boost::shared_ptr< CoraCoolDatabase > CoraCoolDatabasePtr
void summary(const float fread)
CoraCoolDatabasePtr m_coracoolDb
CoraCoolDatabasePtr getCoraCoolDb()
void setReadOnly(const bool readOnly)
const std::string m_connstr
cool::IDatabasePtr getCoolDb()
cool::IDatabasePtr m_coolDb
IOVDbConn(const std::string &dbname, const bool readOnly, MsgStream &msg)