TriggerConfigAccessBase: Python database access inprovements
-
print the maximum available key in the table in case of query failure
Max key query is dynamically constructed based on the original query. Key condition is always listed last, to create query asking for maximum key, it is moved to the "SELECT" section.
-
select query based on the schema version (implemented based on C++ access TrigConf::TrigDBMenuLoader)
For this solution query templates in HLTTriggerConfigAccess and L1TriggerConfigAccess need to be stored in dictionary (with schema version as a key: 2 - new db schema, 1 - current db schema)
Additional database query is made to retrieve the schema version number (based on TrigConf::TrigDBLoader::schemaVersion)
-
getCoralQuery
function was improved to handle queries without "WHERE" condition clause (needed for max key query for prescale sets)
Example failure output with maximum key printout:
HLTMenuAccess(dbalias = "TRIGGERDBREPR_RUN3", smkey = 150)
Py:TriggerConfigAccessBase.py INFO Trying credentials oracle://ATLAS_CONFIG/ATLAS_CONF_TRIGGER_RUN3_REPR
Py:TriggerConfigAccessBase.py INFO Found schema version 2
Py:TriggerConfigAccessBase.py WARNING Failed to execute query: Cursor loop has not started yet ( CORAL : "ICursor::currentRow()" from "CORAL/RelationalPlugins/oracle" )
Py:TriggerConfigAccessBase.py INFO Highest available key is 36
Related to: ATR-24120
Tagging @mark