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 4 of file sessionManager.py.

Constructor & Destructor Documentation

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

Definition at line 8 of file sessionManager.py.

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

6  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>'''
7 
def sessionManager.sessionManager.openSession (   self,
  isReadOnly = True,
  cpp2sqltype = [],
  sql2cpptype = [] 
)

Definition at line 44 of file sessionManager.py.

References sessionManager.sessionManager.__connectString.

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

Definition at line 63 of file sessionManager.py.

References sessionManager.sessionManager.__svc.

Member Data Documentation

sessionManager.sessionManager.__connectparser
private

Definition at line 11 of file sessionManager.py.

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