From b81a0132a84a54559b7dbce075988dec62ed7da7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 17 Apr 2007 00:21:25 +0000 Subject: added "recreate()" argument to connection pool classes this method is called when the invalidate() occurs for a disconnect condition, so that the entire pool is recreated, thereby avoiding repeat errors on remaining connections in the pool. dispose() called as well (also fixed up) but cant guarantee all connections closed. --- lib/sqlalchemy/engine/base.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/engine/base.py') diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 6f0ff029a..e7a3f8feb 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -577,6 +577,7 @@ class Connection(Connectable): except Exception, e: if self.dialect.is_disconnect(e): self.__connection.invalidate(e=e) + self.engine.connection_provider.dispose() self._autorollback() if self.__close_with_result: self.close() @@ -588,6 +589,7 @@ class Connection(Connectable): except Exception, e: if self.dialect.is_disconnect(e): self.__connection.invalidate(e=e) + self.engine.connection_provider.dispose() self._autorollback() if self.__close_with_result: self.close() -- cgit v1.2.1