Commit 9a0583a5 authored by Sebastien Robin's avatar Sebastien Robin

sorry, the transaction cache was deleted, put it back

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11063 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9a5f009
...@@ -207,6 +207,27 @@ class CachingMethod: ...@@ -207,6 +207,27 @@ class CachingMethod:
allow_class(CachingMethod) allow_class(CachingMethod)
# TransactionCache is a cache per transaction. The purpose of this cache is
# to accelerate some heavy read-only operations. Note that this must not be
# enabled when a trasaction may modify ZODB objects.
def getReadOnlyTransactionCache(context):
"""Get the transaction cache.
"""
try:
return context.REQUEST['_erp5_read_only_transaction_cache']
except KeyError:
return None
def enableReadOnlyTransactionCache(context):
"""Enable the transaction cache.
"""
context.REQUEST.set('_erp5_read_only_transaction_cache', {})
def disableReadOnlyTransactionCache(context):
"""Disable the transaction cache.
"""
context.REQUEST.set('_erp5_read_only_transaction_cache', None)
######################################################## ########################################################
## Old global cache functions ## ## Old global cache functions ##
## TODO: Check if it make sense to keep them any more ## ## TODO: Check if it make sense to keep them any more ##
...@@ -219,15 +240,3 @@ def clearCache(method_id=None): ...@@ -219,15 +240,3 @@ def clearCache(method_id=None):
otherwise, it clears the whole cache. otherwise, it clears the whole cache.
""" """
pass pass
def getReadOnlyTransactionCache(context):
""" Get the transaction cache. """
pass
def enableReadOnlyTransactionCache(context):
""" Enable the transaction cache. """
pass
def disableReadOnlyTransactionCache(context):
""" Disable the transaction cache. """
pass
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