CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
sessionManager.sessionManager Class Reference
Inheritance diagram for sessionManager.sessionManager:

Public Member Functions

def __del__ (self)
 
def __init__ (self, connectString, authpath=None, siteconfpath=None, debugON=False)
 
def defaultfrontierConfigString ()
 
def openSession (self, isReadOnly=True, cpp2sqltype=[], sql2cpptype=[])
 
def realConnectString (self)
 
def svcHandle (self)
 

Private Attributes

 __connectparser
 
 __connectString
 
 __svc
 

Detailed Description

Definition at line 5 of file sessionManager.py.

Constructor & Destructor Documentation

def sessionManager.sessionManager.__init__ (   self,
  connectString,
  authpath = None,
  siteconfpath = None,
  debugON = False 
)

Definition at line 9 of file sessionManager.py.

9  def __init__(self,connectString,authpath=None,siteconfpath=None,debugON = False):
10  self.__connectString=connectString
11  self.__svc=None
13  usedefaultfrontierconfig = False
14  cacheconfigpath = ''
15  try:
16  self.__connectparser.parse()
17  if self.__connectparser.needsitelocalinfo():
18  if not siteconfpath:
19  cacheconfigpath = os.environ['CMS_PATH']
20  if cacheconfigpath:
21  cacheconfigpath = os.path.join (cacheconfigpath, 'SITECONF', 'local', 'JobConfig', 'site-local-config.xml')
22  else:
23  usedefaultfrontierconfig = True
24  else:
25  cacheconfigpath = siteconfpath
26  cacheconfigpath = os.path.join (cacheconfigpath, 'site-local-config.xml')
28  if usedefaultfrontierconfig:
29  ccp.parseString ( self.defaultfrontierConfigString() )
30  else:
31  ccp.parse (cacheconfigpath)
32  self.__connectString = self.__connectparser.fullfrontierStr(self.__connectparser.schemaname(), ccp.parameterdict())
33  if self.__connectparser.protocol()=='oracle':
34  if authpath:
35  os.environ['CORAL_AUTH_PATH']=authpath
36  else:
37  os.environ['CORAL_AUTH_PATH']='.'
38  if debugON :
39  msg = coral.MessageStream ('')
40  msg.setMsgVerbosity (coral.message_Level_Debug)
41  self.__svc = coral.ConnectionService()
42  except:
43  if self.__svc: del self.__svc
44  raise
def __init__(self, connectString, authpath=None, siteconfpath=None, debugON=False)
def sessionManager.sessionManager.__del__ (   self)

Member Function Documentation

def sessionManager.sessionManager.defaultfrontierConfigString ( )

Definition at line 6 of file sessionManager.py.

7  return '''<frontier-connect><proxy url = "http://cmst0frontier.cern.ch:3128"/><proxy url = "http://cmst0frontier.cern.ch:3128"/><proxy url = "http://cmst0frontier1.cern.ch:3128"/><proxy url = "http://cmst0frontier2.cern.ch:3128"/><server url = "http://cmsfrontier.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier1.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier2.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier3.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier4.cern.ch:8000/FrontierInt"/></frontier-connect>'''
8 
def sessionManager.sessionManager.openSession (   self,
  isReadOnly = True,
  cpp2sqltype = [],
  sql2cpptype = [] 
)

Definition at line 45 of file sessionManager.py.

References sessionManager.sessionManager.__connectString.

45  def openSession(self,isReadOnly=True,cpp2sqltype=[],sql2cpptype=[] ):
46  try:
47  session=None
48  if self.__connectparser.protocol()=='frontier' or isReadOnly:
49  session = self.__svc.connect(self.__connectString, accessMode = coral.access_ReadOnly)
50  else:
51  session = self.__svc.connect(self.__connectString, accessMode = coral.access_Update)
52  for (cpptype,sqltype) in cpp2sqltype:
53  session.typeConverter().setCppTypeForSqlType(cpptype,sqltype)
54  for (sqltype,cpptype) in sql2cpptype:
55  session.typeConverter().setSqlTypeForCppType(sqltype,cpptype)
56  return session
57  except:
58  if session: del session
59  raise
def openSession(self, isReadOnly=True, cpp2sqltype=[], sql2cpptype=[])
def sessionManager.sessionManager.realConnectString (   self)
def sessionManager.sessionManager.svcHandle (   self)

Definition at line 64 of file sessionManager.py.

References sessionManager.sessionManager.__svc.

Member Data Documentation

sessionManager.sessionManager.__connectparser
private

Definition at line 12 of file sessionManager.py.

sessionManager.sessionManager.__connectString
private
sessionManager.sessionManager.__svc
private