Commit 83dd1ab7 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove use of volatile attribute.

Code calling this method in this class already cache their own result,
and it is not part of the API (so it should not be directly accessed).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37183 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent effb4996
......@@ -814,10 +814,6 @@ class Catalog(Folder,
# Add a dummy item so that SQLCatalog will not use existing uids again.
self.insertMaxUid()
# Remove the cache of catalog schema.
if hasattr(self, '_v_catalog_schema_dict') :
del self._v_catalog_schema_dict
self._clearSecurityCache()
def insertMaxUid(self):
......@@ -909,28 +905,19 @@ class Catalog(Folder,
return self.sql_search_result_keys
def _getCatalogSchema(self, table=None):
# XXX: Using a volatile as a cache makes it impossible to flush
# consistently on all connections containing the volatile. Another
# caching scheme must be used here.
catalog_schema_dict = getattr(aq_base(self), '_v_catalog_schema_dict', {})
if table not in catalog_schema_dict:
result_list = []
try:
method_name = self.sql_catalog_schema
method = getattr(self, method_name)
search_result = method(table=table)
for c in search_result:
result_list.append(c.Field)
except ConflictError:
raise
except:
LOG('SQLCatalog', WARNING, '_getCatalogSchema failed with the method %s' % method_name, error=sys.exc_info())
pass
catalog_schema_dict[table] = tuple(result_list)
self._v_catalog_schema_dict= catalog_schema_dict
return catalog_schema_dict[table]
result_list = []
try:
method_name = self.sql_catalog_schema
method = getattr(self, method_name)
search_result = method(table=table)
for c in search_result:
result_list.append(c.Field)
except ConflictError:
raise
except:
LOG('SQLCatalog', WARNING, '_getCatalogSchema failed with the method %s' % method_name, error=sys.exc_info())
pass
return tuple(result_list)
@caching_instance_method(id='SQLCatalog.getColumnIds',
cache_factory='erp5_content_long')
......
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