Helper to manage database connections.
More...
#include <TrigRDBManager.h>
Helper to manage database connections.
This class is a "friend" of IRDBAccessSvc and allowed to manage database connections.
Definition at line 21 of file TrigRDBManager.h.
◆ closeDBConnections()
| StatusCode TrigRDBManager::closeDBConnections |
( |
MsgStream & | msg | ) |
|
|
inlinestatic |
Close database connections.
- Parameters
-
| msg | reference to MsgStream |
Definition at line 28 of file TrigRDBManager.h.
29 {
30
31 ServiceHandle<IRDBAccessSvc> rdbAccessSvc("RDBAccessSvc", "TrigRDBManager");
32 if (rdbAccessSvc->shutdown("*Everything*")) {
33 msg << MSG::INFO <<
"Cleaning up RDBAccessSvc connections" <<
endmsg;
34 }
35 else {
36 msg << MSG::ERROR <<
"Cleaning up RDBAccessSvc connections failed" <<
endmsg;
37 return StatusCode::FAILURE;
38 }
39
40
41 coral::Context& context = coral::Context::instance();
42
43 coral::IHandle<coral::IConnectionService> connSvcH = context.query<coral::IConnectionService>();
44 if (connSvcH.isValid()) {
45 msg << MSG::INFO <<
"Cleaning up idle CORAL connections" <<
endmsg;
46 connSvcH->purgeConnectionPool();
47 }
48 return StatusCode::SUCCESS;
49 }
The documentation for this class was generated from the following file: