Commit a40cbe4d authored by Vincent Pelletier's avatar Vincent Pelletier

ZSQLCatalog: Use a transactional cache instead of a global cache.

Not perfect yet (what if definitions change during the same transaction ?),
but better than previous state.
parent bf7f27b4
...@@ -289,7 +289,6 @@ class LazyIndexationParameterList(tuple): ...@@ -289,7 +289,6 @@ class LazyIndexationParameterList(tuple):
ContainerAssertions[LazyIndexationParameterList] = 1 ContainerAssertions[LazyIndexationParameterList] = 1
related_key_definition_cache = {}
related_key_warned_column_set = set() related_key_warned_column_set = set()
class Catalog(Folder, class Catalog(Folder,
...@@ -2031,6 +2030,8 @@ class Catalog(Folder, ...@@ -2031,6 +2030,8 @@ class Catalog(Folder,
Returns the definition of given related key name if found, None Returns the definition of given related key name if found, None
otherwise. otherwise.
""" """
related_key_definition_cache = getTransactionalVariable().setdefault(
'SQLCatalog.getRelatedKeyDefinition', {})
try: try:
result = related_key_definition_cache[key] result = related_key_definition_cache[key]
except KeyError: except KeyError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment