diff --git a/trytond/trytond/backend/postgresql/database.py b/trytond/trytond/backend/postgresql/database.py index 7ffdd04ab0..59de18962b 100644 --- a/trytond/trytond/backend/postgresql/database.py +++ b/trytond/trytond/backend/postgresql/database.py @@ -346,7 +346,7 @@ class Database(DatabaseInterface): 'Test failed for "%s"', db_name, exc_info=True) continue finally: - self.put_connection(connection) + self.put_connection(connection, close=True) self.__class__._list_cache[hostname] = res self.__class__._list_cache_timestamp[hostname] = now @@ -391,7 +391,7 @@ class Database(DatabaseInterface): try: return self._test(connection, hostname=hostname) finally: - self.put_connection(connection) + self.put_connection(connection, close=True) @classmethod def _test(cls, connection, hostname=None):