Commit e2ce9081 authored by Sebastien Robin's avatar Sebastien Robin

allow to disable the new cache made by yoshinori for inventories


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4805 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 39281bd5
...@@ -1038,7 +1038,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1038,7 +1038,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
expression_cache = {} expression_cache = {}
try: try:
enableTransactionCache(self) if not disable_cache:
enableTransactionCache(self)
method_kw_dict = {} method_kw_dict = {}
for method_name in method_id_list: for method_name in method_id_list:
...@@ -1125,7 +1126,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1125,7 +1126,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
error=sys.exc_info()) error=sys.exc_info())
raise raise
finally: finally:
disableTransactionCache(self) if not disable_cache:
disableTransactionCache(self)
if psyco is not None: psyco.bind(catalogObjectList) if psyco is not None: psyco.bind(catalogObjectList)
......
...@@ -607,7 +607,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -607,7 +607,7 @@ class ZCatalog(Folder, Persistent, Implicit):
""" wrapper around catalog """ """ wrapper around catalog """
self.catalogObjectList([obj], sql_catalog_id=sql_catalog_id) self.catalogObjectList([obj], sql_catalog_id=sql_catalog_id)
def catalogObjectList(self, object_list, sql_catalog_id=None): def catalogObjectList(self, object_list, sql_catalog_id=None,**kw):
"""Catalog a list of objects. """Catalog a list of objects.
""" """
hot_reindexing = 0 hot_reindexing = 0
...@@ -641,7 +641,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -641,7 +641,7 @@ class ZCatalog(Folder, Persistent, Implicit):
catalog = self.getSQLCatalog(sql_catalog_id) catalog = self.getSQLCatalog(sql_catalog_id)
if catalog is not None: if catalog is not None:
catalog.catalogObjectList(wrapped_object_list) catalog.catalogObjectList(wrapped_object_list,**kw)
if hot_reindexing: if hot_reindexing:
destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id) destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id)
...@@ -649,7 +649,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -649,7 +649,7 @@ class ZCatalog(Folder, Persistent, Implicit):
destination_catalog.recordCatalogObjectList(url_list) destination_catalog.recordCatalogObjectList(url_list)
else: else:
destination_catalog.deleteRecordedObjectList(url_list) # Prevent this object from being replayed. destination_catalog.deleteRecordedObjectList(url_list) # Prevent this object from being replayed.
destination_catalog.catalogObjectList(wrapped_object_list) destination_catalog.catalogObjectList(wrapped_object_list,**kw)
object_list[:] = failed_object_list[:] object_list[:] = failed_object_list[:]
......
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