summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-08-05 15:11:52 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-08-05 15:11:52 +0000
commit2d95e9daec3d44bd8d5725cf0b48cd583f8c2954 (patch)
tree20be0cbdee7d4b8f50b9e66f57ede2020b47e69d /lib
parent110eb68e1a67447ab35f8d20493188ae85dfc180 (diff)
downloadsqlalchemy-2d95e9daec3d44bd8d5725cf0b48cd583f8c2954.tar.gz
temporary workaround dispose_local() added to SingletonThreadPool
for sqlite applications that dispose of threads en masse
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/pool.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py
index d71f645a6..dd27755c5 100644
--- a/lib/sqlalchemy/pool.py
+++ b/lib/sqlalchemy/pool.py
@@ -197,7 +197,13 @@ class SingletonThreadPool(Pool):
# sqlite won't even let you close a conn from a thread that didn't create it
pass
del self._conns[key]
-
+
+ def dispose_local(self):
+ try:
+ del self._conns[thread.get_ident()]
+ except KeyError:
+ pass
+
def status(self):
return "SingletonThreadPool id:%d thread:%d size: %d" % (id(self), thread.get_ident(), len(self._conns))