diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-06-22 12:42:01 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-06-22 12:42:01 -0400 |
commit | e597d3d14527eb163c6fd78e5e135525fc14c3c8 (patch) | |
tree | f9c898dedfcf21bef4ed1344c68ceffb73f6ff0b /lib/sqlalchemy/engine/base.py | |
parent | 5f0a7bb152b30dd7b05771725a7ffe16e3af8f8a (diff) | |
download | sqlalchemy-e597d3d14527eb163c6fd78e5e135525fc14c3c8.tar.gz |
- [bug] Fixed bug whereby if a database restart
affected multiple connections, each
connection would individually invoke a new
disposal of the pool, even though only
one disposal is needed. [ticket:2522]
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 75f6ac29a..297275223 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1833,8 +1833,11 @@ class Connection(Connectable): if is_disconnect: + dbapi_conn_wrapper = self.connection self.invalidate(e) - self.engine.dispose() + if not hasattr(dbapi_conn_wrapper, '_pool') or \ + dbapi_conn_wrapper._pool is self.engine.pool: + self.engine.dispose() else: if cursor: self._safe_close_cursor(cursor) |