patch for StaticPool so that dispose() is useful

Issue #1728 resolved
Mike Bayer repo owner created an issue
--- a/lib/sqlalchemy/pool.py    Mon Mar 08 17:02:56 2010 +0100
+++ b/lib/sqlalchemy/pool.py    Tue Mar 09 10:23:50 2010 -0500
@@ -726,35 +726,10 @@

     """

-    def __init__(self, creator, **params):
-        """
-        Construct a StaticPool.
+    @memoized_property
+    def _conn(self):
+        return self._creator()

-        :param creator: a callable function that returns a DB-API
-          connection object.  The function will be called with
-          parameters.
-
-        :param echo: If True, connections being pulled and retrieved
-          from the pool will be logged to the standard output, as well
-          as pool sizing information.  Echoing can also be achieved by
-          enabling logging for the "sqlalchemy.pool"
-          namespace. Defaults to False.
-
-        :param reset_on_return: If true, reset the database state of
-          connections returned to the pool.  This is typically a
-          ROLLBACK to release locks and transaction resources.
-          Disable at your own peril.  Defaults to True.
-
-        :param listeners: A list of
-          :class:`~sqlalchemy.interfaces.PoolListener`-like objects or
-          dictionaries of callables that receive events when DB-API
-          connections are created, checked out and checked in to the
-          pool.
-
-        """
-        Pool.__init__(self, creator, **params)
-        self._conn = creator()
-    
     @memoized_property
     def connection(self):
         return _ConnectionRecord(self)

Comments (3)

  1. Log in to comment