R [sql source] cnx._cnx checked in cnx.close, don't do it here
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Sat, 01 Aug 2009 01:20:58 +0200
changeset 2620 de68f84b8f54
parent 2619 535bc210f799
child 2621 1b9d08840a0e
R [sql source] cnx._cnx checked in cnx.close, don't do it here
server/sources/extlite.py
server/sources/native.py
--- a/server/sources/extlite.py	Sat Aug 01 01:19:26 2009 +0200
+++ b/server/sources/extlite.py	Sat Aug 01 01:20:58 2009 +0200
@@ -176,10 +176,9 @@
         attached session: release the connection lock if the connection wrapper
         has a connection set
         """
-        if cnx._cnx is not None:
-            # reset _cnx to ensure next thread using cnx will get a new
-            # connection
-            cnx.close()
+        # reset _cnx to ensure next thread using cnx will get a new
+        # connection
+        cnx.close()
 
     def syntax_tree_search(self, session, union,
                            args=None, cachekey=None, varmap=None, debug=0):
--- a/server/sources/native.py	Sat Aug 01 01:19:26 2009 +0200
+++ b/server/sources/native.py	Sat Aug 01 01:20:58 2009 +0200
@@ -171,8 +171,7 @@
             self.get_connection = lambda: ConnectionWrapper(self)
             self.check_connection = lambda cnx: cnx
             def pool_reset(cnx):
-                if cnx._cnx is not None:
-                    cnx.close()
+                cnx.close()
             self.pool_reset = pool_reset
 
     @property