Re: [Sqlalchemy-users] Threading pattern

2006-04-20 Thread Ed Suominen
Here's how I've addressed the same problem on a per-transaction basis, based on some ideas of Valentino Volonghi (aka Dialtone): http://foss.eepatents.com/pNetworkX/browser/trunk/pnetworkx/database.py Note particularly the "transact" function, which is used as a decorator. Here's a usage example

[Sqlalchemy-users] Threading pattern

2006-04-20 Thread Dimi Shahbaz
All, Here is the pattern I have adopted for putting long-running queries into a thread, to avoid blocking the entire application. I'm using twisted's deferToThread(). def runInThread(fun, *args, **kwargs): opts = schema.default_engine.engine.opts dbname = schema.default_engine.engine.n