succeeded. added a test script to attempt testing this.
- fixed mysql reflection of default values to be PassiveDefault
- added reflected 'tinyint' type to MS-SQL [ticket:263]
+- temporary workaround dispose_local() added to SingletonThreadPool
+for sqlite applications that dispose of threads en masse
0.2.6
- big overhaul to schema to allow truly composite primary and foreign
# SQLite connections require the SingletonThreadPool
p = pool.SingletonThreadPool(getconn)
+#### Important Note about Disposing Threads with SingletonThreadPool {@name=note}
+
+SQLite connections automatically use `SingletonThreadPool` to manage connections. This is a simple dictionary of connections mapped to the identifiers of threads. If you are running an application which disposes of threads, such as FastCGI or SimpleHTTPServer, it is *extremely important* that the corresponding SQLite connection within the exiting thread also be removed, or the connection will remain:
+
+ {python}
+ pool.dispose_local()
+
+Or with an engine:
+
+ {python}
+ engine.connection_provider._pool.dispose_local()
+
+A future release of SQLAlchemy will address this in a more automated way.
\ No newline at end of file
# 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))