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.

References visDQMUpload::context, and instance.

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 }
static PFTauRenderPlugin instance
coral::IConnection * m_connection
Definition: RPCDBCom.h:25

◆ ~RPCDBCom()

RPCDBCom::~RPCDBCom ( )
virtual

Definition at line 17 of file RPCDBCom.cc.

References m_connection.

17  {
18  if (m_connection)
19  delete m_connection;
20 }
coral::IConnection * m_connection
Definition: RPCDBCom.h:25

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.

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().

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 }
static PFTauRenderPlugin instance
coral::IConnection * m_connection
Definition: RPCDBCom.h:25

◆ 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.

References personalPlayback::level.

49 { coral::MessageStream::setMsgVerbosity(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().