CMS 3D CMS Logo

DBService.cc
Go to the documentation of this file.
3 #include "RelationalAccess/ConnectionService.h"
4 #include "CoralBase/Exception.h"
5 #include "RelationalAccess/ISessionProxy.h"
6 #include "RelationalAccess/AccessMode.h"
7 
8 #include <iostream>
10  : m_svc(std::make_unique<coral::ConnectionService>()), m_dbconfig(std::make_unique<lumi::DBConfig>(*m_svc)) {
11  std::string authpath = iConfig.getUntrackedParameter<std::string>("authPath", "");
12  if (!authpath.empty()) {
13  m_dbconfig->setAuthentication(authpath);
14  }
15 }
16 
18 
20  std::unique_lock<std::mutex> lock(m_mutex);
21 
22  return ISessionProxyPtr(std::unique_ptr<coral::ISessionProxy>(m_svc->connect(connectstring, coral::ReadOnly)),
23  std::move(lock));
24 }
lumi::service::ISessionProxyPtr
Definition: DBService.h:16
l1RCTOmdsFedVectorProducer_cfi.authpath
authpath
Definition: l1RCTOmdsFedVectorProducer_cfi.py:5
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
lumi::service::DBService::DBService
DBService(const edm::ParameterSet &iConfig)
Definition: DBService.cc:9
coral
Definition: Binary.h:9
DBService.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
CommonMethods.lock
def lock()
Definition: CommonMethods.py:82
lumi::DBConfig
Definition: DBConfig.h:8
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
lumi::service::DBService::m_dbconfig
std::unique_ptr< lumi::DBConfig > m_dbconfig
Definition: DBService.h:37
DBConfig.h
lumi
Definition: LumiSectionData.h:20
lumi::service::DBService::~DBService
~DBService()
Definition: DBService.cc:17
lumi::service::DBService::connectReadOnly
ISessionProxyPtr connectReadOnly(const std::string &connectstring)
Definition: DBService.cc:19