diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-06-19 11:49:49 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-06-19 11:49:49 -0400 |
| commit | 3d78705cf4981e460d6d1b5bb08870286fc3fe93 (patch) | |
| tree | 44601fe5f4b62d4dc103d4ae0b7af7b0130b51e2 /lib/sqlalchemy/engine/base.py | |
| parent | 370b237ddb6af0ba62f0ce5b1bedfe7556c6ccf3 (diff) | |
| download | sqlalchemy-3d78705cf4981e460d6d1b5bb08870286fc3fe93.tar.gz | |
- add explciit section on engine disposal, fixes #3461
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
| -rw-r--r-- | lib/sqlalchemy/engine/base.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 59754a436..dea92e512 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1811,25 +1811,21 @@ class Engine(Connectable, log.Identified): def dispose(self): """Dispose of the connection pool used by this :class:`.Engine`. + This has the effect of fully closing all **currently checked in** + database connections. Connections that are still checked out + will **not** be closed, however they will no longer be associated + with this :class:`.Engine`, so when they are closed individually + they will close out fully. + A new connection pool is created immediately after the old one has been disposed. This new pool, like all SQLAlchemy connection pools, does not make any actual connections to the database until one is - first requested. - - This method has two general use cases: + first requested, so as long as the :class:`.Engine` isn't used again, + no new connections will be made. - * When a dropped connection is detected, it is assumed that all - connections held by the pool are potentially dropped, and - the entire pool is replaced. - - * An application may want to use :meth:`dispose` within a test - suite that is creating multiple engines. + .. seealso:: - It is critical to note that :meth:`dispose` does **not** guarantee - that the application will release all open database connections - only - those connections that are checked into the pool are closed. - Connections which remain checked out or have been detached from - the engine are not affected. + :ref:`engine_disposal` """ self.pool.dispose() |
