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
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
2 matches
Mail list logo