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, ...@@ -814,10 +814,6 @@ class Catalog(Folder,
# Add a dummy item so that SQLCatalog will not use existing uids again. # Add a dummy item so that SQLCatalog will not use existing uids again.
self.insertMaxUid() self.insertMaxUid()
# Remove the cache of catalog schema.
if hasattr(self, '_v_catalog_schema_dict') :
del self._v_catalog_schema_dict
self._clearSecurityCache() self._clearSecurityCache()
def insertMaxUid(self): def insertMaxUid(self):
...@@ -909,12 +905,6 @@ class Catalog(Folder, ...@@ -909,12 +905,6 @@ class Catalog(Folder,
return self.sql_search_result_keys return self.sql_search_result_keys
def _getCatalogSchema(self, table=None): 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 = [] result_list = []
try: try:
method_name = self.sql_catalog_schema method_name = self.sql_catalog_schema
...@@ -927,10 +917,7 @@ class Catalog(Folder, ...@@ -927,10 +917,7 @@ class Catalog(Folder,
except: except:
LOG('SQLCatalog', WARNING, '_getCatalogSchema failed with the method %s' % method_name, error=sys.exc_info()) LOG('SQLCatalog', WARNING, '_getCatalogSchema failed with the method %s' % method_name, error=sys.exc_info())
pass pass
catalog_schema_dict[table] = tuple(result_list) return tuple(result_list)
self._v_catalog_schema_dict= catalog_schema_dict
return catalog_schema_dict[table]
@caching_instance_method(id='SQLCatalog.getColumnIds', @caching_instance_method(id='SQLCatalog.getColumnIds',
cache_factory='erp5_content_long') 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