[connection] move local_perm_cache management on Connection
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 27 Jun 2013 11:19:42 +0200
changeset 9082 a2c6d908edeb
parent 9081 7c9a6dc4ee5d
child 9083 fe254c803ed1
[connection] move local_perm_cache management on Connection It belongs here anyway.
server/session.py
--- a/server/session.py	Thu Jun 27 11:19:37 2013 +0200
+++ b/server/session.py	Thu Jun 27 11:19:42 2013 +0200
@@ -509,6 +509,7 @@
         #: (None, 'precommit', 'postcommit', 'uncommitable')
         self.commit_state = None
         self.pruned_hooks_cache = {}
+        self.local_perm_cache.clear()
 
     # Connection Set Management ###############################################
     @property
@@ -1224,7 +1225,13 @@
     def _touch(self):
         """update latest session usage timestamp and reset mode to read"""
         self._timestamp.touch()
-        self.local_perm_cache.clear() # XXX simply move in cnx.transaction_data, no?
+
+    local_perm_cache = cnx_attr('local_perm_cache')
+    @local_perm_cache.setter
+    def local_perm_cache(self, value):
+        #base class assign an empty dict:-(
+        assert value == {}
+        pass
 
     # shared data handling ###################################################