diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-01-20 19:04:06 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-01-20 19:04:06 +0000 |
commit | 08bbc3dfd84234c3cd691e43ff17ed36e2396d76 (patch) | |
tree | d29aae27cb4bd1ece9f76eb58d211dcd97864966 /lib/sqlalchemy/engine/base.py | |
parent | 8c3ede4b6f1a3aead8be31e8f7ebee42888c369a (diff) | |
download | sqlalchemy-08bbc3dfd84234c3cd691e43ff17ed36e2396d76.tar.gz |
clean up a little close() silliness
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index f2a1cd286..769217454 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -627,7 +627,7 @@ class Connection(Connectable): The underlying DB-API connection is literally closed (if possible), and is discarded. Its source connection pool will - typically lazilly create a new connection to replace it. + typically lazily create a new connection to replace it. Upon the next usage, this Connection will attempt to reconnect to the pool with a new connection. @@ -819,17 +819,19 @@ class Connection(Connectable): """Close this Connection.""" try: - c = self.__connection + conn = self.__connection except AttributeError: return if not self.__branch: - self.__connection.close() - self.__connection = None + conn.close() self.__invalid = False del self.__connection def scalar(self, object, *multiparams, **params): - """Executes and returns the first column of the first row.""" + """Executes and returns the first column of the first row. + + The underlying result/cursor is closed after execution. + """ return self.execute(object, *multiparams, **params).scalar() |