[R source cnx] use connection wrapper's close method
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Sat, 01 Aug 2009 00:00:29 +0200
changeset 2611 0557f25682da
parent 2610 2933cc6bf9ad
child 2616 4501ee760eec
[R source cnx] use connection wrapper's close method
server/sources/extlite.py
server/sources/native.py
--- a/server/sources/extlite.py	Fri Jul 31 23:58:53 2009 +0200
+++ b/server/sources/extlite.py	Sat Aug 01 00:00:29 2009 +0200
@@ -170,10 +170,9 @@
         has a connection set
         """
         if cnx._cnx is not None:
-            cnx._cnx.close()
             # reset _cnx to ensure next thread using cnx will get a new
             # connection
-            cnx._cnx = None
+            cnx.close()
 
     def syntax_tree_search(self, session, union,
                            args=None, cachekey=None, varmap=None, debug=0):
--- a/server/sources/native.py	Fri Jul 31 23:58:53 2009 +0200
+++ b/server/sources/native.py	Sat Aug 01 00:00:29 2009 +0200
@@ -172,8 +172,7 @@
             self.check_connection = lambda cnx: cnx
             def pool_reset(cnx):
                 if cnx._cnx is not None:
-                    cnx._cnx.close()
-                    cnx._cnx = None
+                    cnx.close()
             self.pool_reset = pool_reset
 
     @property