From 489e297cf25f4c2e2351f2f0d4e21facb3256fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Nov 2012 22:37:57 +0100 Subject: [PATCH] Store transaction counter on local cache As the cache is shared with many instances, the counter must also be shared. review599004 --- trytond/model/modelstorage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py index c43c0a6721..371bcce5ea 100644 --- a/trytond/model/modelstorage.py +++ b/trytond/model/modelstorage.py @@ -1123,7 +1123,7 @@ class ModelStorage(Model): self._local_cache = _local_cache else: self._local_cache = LRUDict(RECORD_CACHE_SIZE) - self._local_counter = Transaction().counter + self._local_cache.counter = Transaction().counter @property def _cache(self): @@ -1140,9 +1140,9 @@ class ModelStorage(Model): raise counter = Transaction().counter - if self._local_counter != counter: + if self._local_cache.counter != counter: self._local_cache.clear() - self._local_counter = counter + self._local_cache.counter = counter try: return self._local_cache[self.id][name] except KeyError: