[F native source] fix attempts to clear cache key
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 31 Jul 2009 23:58:53 +0200
changeset 2610 2933cc6bf9ad
parent 2609 a0f6fa90cc32
child 2611 0557f25682da
[F native source] fix attempts to clear cache key
server/sources/native.py
--- a/server/sources/native.py	Fri Jul 31 23:55:50 2009 +0200
+++ b/server/sources/native.py	Fri Jul 31 23:58:53 2009 +0200
@@ -189,8 +189,9 @@
 
     def clear_eid_cache(self, eid, etype):
         """clear potential caches for the given eid"""
-        self._cache.pop('%s X WHERE X eid %s' % (etype, eid), None)
+        self._cache.pop('Any X WHERE X eid %s, X is %s' % (eid, etype), None)
         self._cache.pop('Any X WHERE X eid %s' % eid, None)
+        self._cache.pop('Any %s' % eid, None)
 
     def sqlexec(self, session, sql, args=None):
         """execute the query and return its result"""
@@ -436,8 +437,6 @@
         """Execute a query.
         it's a function just so that it shows up in profiling
         """
-        if server.DEBUG:
-            print 'exec', query, args
         cursor = session.pool[self.uri]
         if server.DEBUG & server.DBG_SQL:
             print 'exec', query, args, session.pool.connection(self.uri)._cnx