Commit 2bacf683 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Enable a transaction cache in catalogObjectList if possible.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4630 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 85ad9a8f
...@@ -58,6 +58,14 @@ try: ...@@ -58,6 +58,14 @@ try:
except ImportError: except ImportError:
psyco = None psyco = None
try:
from Products.ERP5Type.Cache import enableTransactionCache, disableTransactionCache
except ImportError:
def doNothing(context):
pass
enableTransactionCache = doNothing
disableTransactionCache = doNothing
UID_BUFFER_SIZE = 300 UID_BUFFER_SIZE = 300
valid_method_meta_type_list = ('Z SQL Method', 'Script (Python)') valid_method_meta_type_list = ('Z SQL Method', 'Script (Python)')
...@@ -1021,6 +1029,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1021,6 +1029,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
argument_cache = {} argument_cache = {}
expression_cache = {} expression_cache = {}
try:
enableTransactionCache(self)
method_kw_dict = {} method_kw_dict = {}
for method_name in methods: for method_name in methods:
kw = {} kw = {}
...@@ -1104,6 +1115,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1104,6 +1115,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
LOG("SQLCatalog Warning: could not catalog objects with method %s" % method_name,100, str(object_list), LOG("SQLCatalog Warning: could not catalog objects with method %s" % method_name,100, str(object_list),
error=sys.exc_info()) error=sys.exc_info())
raise raise
finally:
disableTransactionCache(self)
if psyco is not None: psyco.bind(catalogObjectList) if psyco is not None: psyco.bind(catalogObjectList)
......
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