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,28 +905,19 @@ class Catalog(Folder, ...@@ -909,28 +905,19 @@ 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 result_list = []
# consistently on all connections containing the volatile. Another try:
# caching scheme must be used here. method_name = self.sql_catalog_schema
catalog_schema_dict = getattr(aq_base(self), '_v_catalog_schema_dict', {}) method = getattr(self, method_name)
search_result = method(table=table)
if table not in catalog_schema_dict: for c in search_result:
result_list = [] result_list.append(c.Field)
try: except ConflictError:
method_name = self.sql_catalog_schema raise
method = getattr(self, method_name) except:
search_result = method(table=table) LOG('SQLCatalog', WARNING, '_getCatalogSchema failed with the method %s' % method_name, error=sys.exc_info())
for c in search_result: pass
result_list.append(c.Field) return tuple(result_list)
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]
@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