9 #include "RelationalAccess/ConnectionService.h"
10 #include "RelationalAccess/IWebCacheControl.h"
11 #include "RelationalAccess/ISessionProxy.h"
12 #include "RelationalAccess/IConnectionServiceConfiguration.h"
13 #include "CoralKernel/Context.h"
14 #include "CoralKernel/IProperty.h"
15 #include "CoralKernel/IPropertyManager.h"
17 #include <boost/filesystem/operations.hpp>
21 namespace persistency {
26 m_messageLevel( coral::Error ),
27 m_loggingEnabled(
false ),
63 coral::MsgLevel
level = coral::Error;
64 switch (messageLevel) {
69 level = coral::Warning;
90 coralConfig.disablePoolAutomaticCleanUp();
91 coralConfig.disableConnectionSharing();
94 std::string authServiceName(
"CORAL/Services/EnvironmentAuthenticationService");
97 if( authPath.empty() ){
108 authSys = ::atoi( authSysEnv );
116 if( authPath.empty() ){
117 const char* authEnv = ::getenv(
"HOME");
122 servName =
"COND/Services/RelationalAuthenticationService";
124 if( authPath.empty() ){
127 servName =
"COND/Services/XMLAuthenticationService";
129 if( !authPath.empty() ){
130 authServiceName = servName;
134 coralConfig.setAuthenticationService( authServiceName );
138 coral::ConnectionService connServ;
143 coral::ConnectionService connServ;
144 std::pair<std::string,std::string> fullConnectionPars =
getRealConnectionString( connectionString, transactionId );
145 if( !fullConnectionPars.second.empty() )
146 for(
auto tableName :
m_refreshtablelist ) connServ.webCacheControl().refreshTable( fullConnectionPars.second, tableName );
148 boost::shared_ptr<coral::ISessionProxy> coralSession( connServ.connect( fullConnectionPars.first,
149 writeCapable?coral::Update:coral::ReadOnly ) );
150 return Session( coralSession, connectionString );
T getUntrackedParameter(std::string const &, T const &) const
static PFTauRenderPlugin instance
static const std::string COND_AUTH_PATH_PROPERTY
std::pair< std::string, std::string > getRealConnectionString(const std::string &initialConnection)
void setParameters(const edm::ParameterSet &connectionPset)
void setAuthenticationSystem(int authSysCode)
static const char * COND_AUTH_SYS
void setLogging(bool flag)
Session createSession(const std::string &connectionString, bool writeCapable=false)
bool isLoggingEnabled() const
void setMessageVerbosity(coral::MsgLevel level)
coral::MsgLevel m_messageLevel
static const char * COND_AUTH_PATH
Session createReadOnlySession(const std::string &connectionString, const std::string &transactionId)
volatile std::atomic< bool > shutdown_flag false
cond::CoralServiceManager * m_pluginManager
void setAuthenticationPath(const std::string &p)
std::vector< std::string > m_refreshtablelist