CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
RPCDBCom Class Referenceabstract

#include <RPCDBCom.h>

Inheritance diagram for RPCDBCom:
RPCFw

Public Member Functions

 RPCDBCom ()
 
virtual void run ()=0
 
void setVerbosityLevel (coral::MsgLevel level)
 
virtual ~RPCDBCom ()
 

Protected Member Functions

coral::ISession * connect (const std::string &connectionString, const std::string &userName, const std::string &password)
 

Private Attributes

coral::IConnection * m_connection
 

Detailed Description

Definition at line 12 of file RPCDBCom.h.

Constructor & Destructor Documentation

◆ RPCDBCom()

RPCDBCom::RPCDBCom ( )

Definition at line 8 of file RPCDBCom.cc.

8  : m_connection(nullptr) {
9  coral::Context& context = coral::Context::instance();
10  context.loadComponent("CORAL/RelationalPlugins/oracle");
11  coral::IHandle<coral::IRelationalDomain> domain =
12  context.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle");
13  if (!domain.isValid())
14  throw std::runtime_error("Could not load the OracleAccess plugin");
15 }

References instance.

◆ ~RPCDBCom()

RPCDBCom::~RPCDBCom ( )
virtual

Definition at line 17 of file RPCDBCom.cc.

17  {
18  if (m_connection)
19  delete m_connection;
20 }

References m_connection.

Member Function Documentation

◆ connect()

coral::ISession * RPCDBCom::connect ( const std::string &  connectionString,
const std::string &  userName,
const std::string &  password 
)
protected

Definition at line 22 of file RPCDBCom.cc.

24  {
25  coral::Context& ctx = coral::Context::instance();
26  ctx.loadComponent("CORAL/RelationalPlugins/oracle");
27  coral::IHandle<coral::IRelationalDomain> iHandle =
28  ctx.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle");
29  if (!iHandle.isValid()) {
30  throw std::runtime_error("Could not load the OracleAccess plugin");
31  }
32  std::pair<std::string, std::string> connectionAndSchema = iHandle->decodeUserConnectionString(connectionString);
33 
34  if (!m_connection)
35  m_connection = iHandle->newConnection(connectionAndSchema.first);
36 
37  if (!m_connection->isConnected())
38  m_connection->connect();
39 
40  coral::ISession* session = m_connection->newSession(connectionAndSchema.second);
41 
42  if (session) {
43  session->startUserSession(userName, password);
44  }
45  //memory leaking
46  return session;
47 }

References l1RCTOmdsFedVectorProducer_cfi::connectionString, instance, m_connection, EcalCondDBWriter_cfi::password, and EcalCondDBWriter_cfi::userName.

Referenced by RPCFw::createFEB(), RPCFw::createGAS(), RPCFw::createIDMAP(), RPCFw::createIMON(), RPCFw::createMix(), RPCFw::createSTATUS(), RPCFw::createT(), RPCFw::createUXC(), RPCFw::createVMON(), and o2o_db_cfgmap.DbManagerDAQ::update_hashmap().

◆ run()

virtual void RPCDBCom::run ( )
pure virtual

Implemented in RPCFw.

Referenced by Types.EventID::cppID(), and Types.LuminosityBlockID::cppID().

◆ setVerbosityLevel()

void RPCDBCom::setVerbosityLevel ( coral::MsgLevel  level)

Definition at line 49 of file RPCDBCom.cc.

49 { coral::MessageStream::setMsgVerbosity(level); }

References personalPlayback::level.

Member Data Documentation

◆ m_connection

coral::IConnection* RPCDBCom::m_connection
private

Definition at line 25 of file RPCDBCom.h.

Referenced by connect(), and ~RPCDBCom().

personalPlayback.level
level
Definition: personalPlayback.py:22
RPCDBCom::m_connection
coral::IConnection * m_connection
Definition: RPCDBCom.h:25
EcalCondDBWriter_cfi.userName
userName
Definition: EcalCondDBWriter_cfi.py:61
EcalCondDBWriter_cfi.password
password
Definition: EcalCondDBWriter_cfi.py:62
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
l1RCTOmdsFedVectorProducer_cfi.connectionString
connectionString
Definition: l1RCTOmdsFedVectorProducer_cfi.py:4