]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
clean up a little close() silliness
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 20 Jan 2008 19:04:06 +0000 (19:04 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 20 Jan 2008 19:04:06 +0000 (19:04 +0000)
lib/sqlalchemy/engine/base.py

index f2a1cd286443ff0243270c1f76e6065e4963a775..7692174543ea2880897cf76973f48d5e0fbc5815 100644 (file)
@@ -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()