From 8f30ab04befc11f9705fbfe1579b0cfc40aac3d7 Mon Sep 17 00:00:00 2001 From: Cedric Le Brouster Date: Mon, 30 Jun 2014 13:48:52 +0200 Subject: [PATCH] [FIX] sql_db: close db connexions before removing them. Closes #831 aka lp 1322191 --- openerp/sql_db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/sql_db.py b/openerp/sql_db.py index 1c57b729569..39c87049fb0 100644 --- a/openerp/sql_db.py +++ b/openerp/sql_db.py @@ -430,6 +430,8 @@ class ConnectionPool(object): for i, (cnx, used) in enumerate(self._connections): if not used: self._connections.pop(i) + if not cnx.closed: + cnx.close() self._debug('Removing old connection at index %d: %r', i, cnx.dsn) break else: