From e2ce90811aa6668452677639de10d1ec045ef408 Mon Sep 17 00:00:00 2001 From: Sebastien Robin <seb@nexedi.com> Date: Tue, 20 Dec 2005 15:38:53 +0000 Subject: [PATCH] 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 --- product/ZSQLCatalog/SQLCatalog.py | 6 ++++-- product/ZSQLCatalog/ZSQLCatalog.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py index 24046e2b11..35a2a3fd66 100755 --- a/product/ZSQLCatalog/SQLCatalog.py +++ b/product/ZSQLCatalog/SQLCatalog.py @@ -1038,7 +1038,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): expression_cache = {} try: - enableTransactionCache(self) + if not disable_cache: + enableTransactionCache(self) method_kw_dict = {} for method_name in method_id_list: @@ -1125,7 +1126,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): error=sys.exc_info()) raise finally: - disableTransactionCache(self) + if not disable_cache: + disableTransactionCache(self) if psyco is not None: psyco.bind(catalogObjectList) diff --git a/product/ZSQLCatalog/ZSQLCatalog.py b/product/ZSQLCatalog/ZSQLCatalog.py index 7c5b1278d6..c0b3b084e6 100755 --- a/product/ZSQLCatalog/ZSQLCatalog.py +++ b/product/ZSQLCatalog/ZSQLCatalog.py @@ -607,7 +607,7 @@ class ZCatalog(Folder, Persistent, Implicit): """ wrapper around catalog """ 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. """ hot_reindexing = 0 @@ -641,7 +641,7 @@ class ZCatalog(Folder, Persistent, Implicit): catalog = self.getSQLCatalog(sql_catalog_id) if catalog is not None: - catalog.catalogObjectList(wrapped_object_list) + catalog.catalogObjectList(wrapped_object_list,**kw) if hot_reindexing: destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id) @@ -649,7 +649,7 @@ class ZCatalog(Folder, Persistent, Implicit): destination_catalog.recordCatalogObjectList(url_list) else: 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[:] -- 2.30.9