]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add a warning to SingletonThreadPool that it isn't for general use
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Apr 2015 15:04:21 +0000 (11:04 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Apr 2015 15:04:43 +0000 (11:04 -0400)
(cherry picked from commit 732fb99fc0afbeb69d684b2bfa6d0be6250919a3)

lib/sqlalchemy/pool.py

index 65ef5e42bdb5df52afe9ed89c248b9dde7bf22e5..54cc13c75a3408001a39c6c4f0c57c038fe1975d 100644 (file)
@@ -811,6 +811,19 @@ class SingletonThreadPool(Pool):
     Maintains one connection per each thread, never moving a connection to a
     thread other than the one which it was created in.
 
+    .. warning::  the :class:`.SingletonThreadPool` will call ``.close()``
+       on arbitrary connections that exist beyond the size setting of
+       ``pool_size``, e.g. if more unique **thread identities**
+       than what ``pool_size`` states are used.   This cleanup is
+       non-deterministic and not sensitive to whether or not the connections
+       linked to those thread identities are currently in use.
+
+       :class:`.SingletonThreadPool` may be improved in a future release,
+       however in its current status it is generally used only for test
+       scenarios using a SQLite ``:memory:`` database and is not recommended
+       for production use.
+
+
     Options are the same as those of :class:`.Pool`, as well as:
 
     :param pool_size: The number of threads in which to maintain connections