diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-05-30 16:24:38 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-05-30 16:24:38 -0400 |
commit | 814637e291953bc7e05ced3e215ef33bde5b040a (patch) | |
tree | 7b46787f2b04ae06bb2934833d827bfb04b90036 /lib/sqlalchemy/engine/base.py | |
parent | 8daa6ccfb0be6486d36ebdd3cd709e8ebfbfa207 (diff) | |
download | sqlalchemy-814637e291953bc7e05ced3e215ef33bde5b040a.tar.gz |
- vastly improve the "safe close cursor" tests in test_reconnect
- Fixed bug which would occur if a DBAPI exception
occurs when the engine first connects and does its initial checks,
and the exception is not a disconnect exception, yet the cursor
raises an error when we try to close it. In this case the real
exception would be quashed as we tried to log the cursor close
exception via the connection pool and failed, as we were trying
to access the pool's logger in a way that is inappropriate
in this very specific scenario. fixes #3063
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index f9fc04d76..249c494fe 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1054,8 +1054,9 @@ class Connection(Connectable): except (SystemExit, KeyboardInterrupt): raise except Exception: - self.connection._logger.error( - "Error closing cursor", exc_info=True) + # log the error through the connection pool's logger. + self.engine.pool.logger.error( + "Error closing cursor", exc_info=True) _reentrant_error = False _is_disconnect = False |