[server/session] avoid spurious warnings from Session.close
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 29 Jan 2014 15:25:05 +0100
changeset 9509 592c22e1c5f0
parent 9508 1263f1258796
child 9510 a5231a557ac0
[server/session] avoid spurious warnings from Session.close Add internal non-noisy _rollback method.
server/session.py
--- a/server/session.py	Wed Jan 29 15:29:49 2014 +0100
+++ b/server/session.py	Wed Jan 29 15:25:05 2014 +0100
@@ -1638,8 +1638,11 @@
             self._clear_thread_data(free_cnxset)
 
     @deprecated('[3.19] use a Connection object instead')
-    def rollback(self, free_cnxset=True, **kwargs):
+    def rollback(self, *args, **kwargs):
         """rollback the current session's transaction"""
+        return self._rollback(*args, **kwargs)
+
+    def _rollback(self, free_cnxset=True, **kwargs):
         try:
             return self._cnx.rollback(free_cnxset, **kwargs)
         finally:
@@ -1651,7 +1654,7 @@
         with self._lock:
             self._closed = True
         tracker.close()
-        self.rollback()
+        self._rollback()
         self.debug('waiting for open connection of session: %s', self)
         timeout = 10
         pendings = tracker.wait(timeout)