#include <IOVDbConn.h>
Definition at line 18 of file IOVDbConn.h.
◆ IOVDbConn()
| IOVDbConn::IOVDbConn |
( |
const std::string & | dbname, |
|
|
const bool | readOnly, |
|
|
MsgStream & | msg ) |
Definition at line 17 of file IOVDbConn.cxx.
18 :
26
27}
const std::string m_connstr
◆ ~IOVDbConn()
| IOVDbConn::~IOVDbConn |
( |
| ) |
|
|
default |
◆ aborted()
| bool IOVDbConn::aborted |
( |
| ) |
const |
|
inline |
◆ close()
| void IOVDbConn::close |
( |
| ) |
|
◆ decUsage()
| void IOVDbConn::decUsage |
( |
| ) |
|
|
inline |
◆ dropAndReconnect()
| bool IOVDbConn::dropAndReconnect |
( |
| ) |
|
Definition at line 85 of file IOVDbConn.cxx.
85 {
86 bool success{};
87 try {
90 } catch (std::exception& e) {
91 m_log << MSG::WARNING <<
"Exception from disconnect/reconnect: " <<
e.what() <<
endmsg;
92
93 try {
95 } catch (std::exception& e) {
96 m_log << MSG::ERROR <<
"Cannot reconnect to database:" <<
e.what()<<
endmsg;
97 }
98 }
99 return success;
100}
◆ getCoolDb()
| cool::IDatabasePtr IOVDbConn::getCoolDb |
( |
| ) |
|
Definition at line 31 of file IOVDbConn.cxx.
31 {
32
34
36 m_log << MSG::ERROR <<
"COOL connection for " <<
m_connstr <<
" already aborted as invalid" <<
endmsg;
37
38
40 }
41
44 cool::IDatabaseSvc&
dbSvc = cool::DatabaseSvcFactory::databaseService();
45 try {
48 } catch (std::exception& e) {
49
51 m_log << MSG::INFO <<
"*** COOL exception caught: " <<
e.what() <<
endmsg;
53 try {
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;
61 }
62 } else {
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;
67 }
68 }
69 }
71}
cool::IDatabasePtr m_coolDb
◆ getCoraCoolDb()
Definition at line 102 of file IOVDbConn.cxx.
102 {
103
105
107 coral::ConnectionService connSvc;
110 }
112}
boost::shared_ptr< CoraCoolDatabase > CoraCoolDatabasePtr
CoraCoolDatabasePtr m_coracoolDb
◆ getFolderPtr() [1/2]
template<typename T = cool::IFolderPtr>
| T IOVDbConn::getFolderPtr |
( |
const std::string & | folderName | ) |
|
|
inline |
◆ getFolderPtr() [2/2]
◆ incUsage()
| void IOVDbConn::incUsage |
( |
| ) |
|
|
inline |
◆ isActive()
| bool IOVDbConn::isActive |
( |
| ) |
const |
|
inline |
◆ isReadOnly()
| bool IOVDbConn::isReadOnly |
( |
| ) |
const |
|
inline |
◆ name()
| const std::string & IOVDbConn::name |
( |
| ) |
const |
|
inline |
◆ nFolders()
| unsigned int IOVDbConn::nFolders |
( |
| ) |
const |
|
inline |
◆ open()
Definition at line 74 of file IOVDbConn.cxx.
74 {
77}
cool::IDatabasePtr getCoolDb()
◆ setInactive()
| void IOVDbConn::setInactive |
( |
| ) |
|
Definition at line 114 of file IOVDbConn.cxx.
114 {
117 try {
119 } catch (std::exception& e) {
120 m_log << MSG::INFO <<
"Exception caught when disconnecting: " <<
e.what() <<
endmsg;
121 }
123 }
126 try {
128 } catch (std::exception& e) {
129 m_log << MSG::INFO <<
"Exception caught when disconnecting CoraCool: "<<
e.what() <<
endmsg;
130 }
132 }
134}
◆ setReadOnly()
| void IOVDbConn::setReadOnly |
( |
const bool | readOnly | ) |
|
◆ summary()
| void IOVDbConn::summary |
( |
const float | fread | ) |
|
Definition at line 143 of file IOVDbConn.cxx.
143 {
144
145 m_log << MSG::INFO <<
"Connection " <<
m_connstr <<
" : nConnect: " <<
147 std::setw(8) << std::setprecision(2) << fread <<
" ))s" <<
endmsg;
148}
◆ valid()
| bool IOVDbConn::valid |
( |
| ) |
const |
|
inline |
◆ m_abort
◆ m_active
◆ m_connstr
| const std::string IOVDbConn::m_connstr |
|
private |
◆ m_coolDb
| cool::IDatabasePtr IOVDbConn::m_coolDb |
|
private |
◆ m_coracoolDb
◆ m_log
| MsgStream& IOVDbConn::m_log |
|
private |
◆ m_nconn
| unsigned int IOVDbConn::m_nconn |
|
private |
◆ m_nfolder
| unsigned int IOVDbConn::m_nfolder |
|
private |
◆ m_readonly
| bool IOVDbConn::m_readonly |
|
private |
The documentation for this class was generated from the following files: