32 svc = coral.ConnectionService()
33 svcconfig = svc.configuration()
34 svcconfig.disablePoolAutomaticCleanUp()
35 svcconfig.setConnectionTimeOut(0)
38 if not (
'FRONTIER_SERVER' in os.environ
and os.environ[
'FRONTIER_SERVER']):
39 svcconfig.setConnectionRetrialPeriod(1)
40 svcconfig.setConnectionRetrialTimeOut(1)
42 svcconfig.setConnectionRetrialPeriod(300)
43 svcconfig.setConnectionRetrialTimeOut(3600)
45 self.
dbSession = svc.connect(
'ATLASDD', accessMode = coral.access_ReadOnly )
46 transaction = self.
dbSession.transaction()
49 transaction.start(
True)
59 """ Read the geometry Id corresponding to the geometry tag name in order to collect the child node Id's """
61 query = self.
dbSchema.tableHandle(
"HVS_TAG2NODE").newQuery()
63 query.addToOutputList(
'TAG_NAME')
64 query.addToOutputList(
'TAG_ID')
66 bindstag2node = coral.AttributeList()
67 bindstag2node.extend(
'tagN',
'string')
68 bindstag2node[0].setData(self.
dbGeoTag)
69 condString=
'TAG_NAME=:tagN'
71 query.setCondition(condString,bindstag2node)
73 for currentRow
in iter(query.execute()):
74 for i
in range(0,currentRow.size()):
75 if currentRow[i].specification().name()==
"TAG_ID":
76 Logging.log.verbose(
"*** GeoTagId ******** "+str(currentRow))
85 """ Analyze request output -> return a list of dictionaries and a list of parameter types """
92 for row
in iter(request.execute()):
95 for j
in range(0,row.size()):
96 name=row[j].specification().name()
97 paramType=row[j].specification().typeName()
101 if iCmpt==0: typeList.append((name,paramType))
103 dataList.append(dictLoc)
107 return dataList,typeList
113 v=[d[paramName]
for paramName,tmp
in typeList
if paramName!=keyName]
116 return dataDict,typeList
172 """ Read a DB table content and return 3 lists :
173 - dbId : the data_id list corresponding to each entry in the table
174 - dbContent : the table values as a dictionary with keys corresponding to the dbId list
175 - paramName : the name of the table parameters """
177 upLeafName=leafName.upper()
184 return dbId,dbContent,paramName
190 query = self.
dbSchema.tableHandle(upLeafName+
"_DATA2TAG").newQuery()
191 query.addToOutputList(upLeafName+
'_DATA_ID')
193 bindstag2node = coral.AttributeList()
194 condString=upLeafName+
'_TAG_ID='+str(leafTagId)
195 query.setCondition(condString,bindstag2node)
198 dataIdList=[int(s[upLeafName+
'_DATA_ID'])
for s
in dictRes]
203 query = self.
dbSchema.tableHandle(upLeafName+
"_DATA").newQuery()
205 condString=upLeafName+
'_DATA_ID IN ('+str(dataIdList)[1:-1]+
") ORDER BY "+upLeafName+
"_DATA_ID"
206 query.setCondition(condString,bindstag2node)
216 paramName=[s[0]
for s
in typeList]
218 paramKey=typeList[0][0]
224 v=[s[k[0]]
for k
in typeList]
227 return dbId,dbContent,paramName