[Twisted-Python] Re adbapi and multiple queries in single transaction.

Vishal Shetye vishal_shetye at persistent.co.in
Tue Jul 14 10:29:07 EDT 2009


I went through several posts and blogs regarding long lived transactions in twisted.

Some of them are

-        A bug with current status won't fix. http://twistedmatrix.com/trac/ticket/303

-        Laxdb from sandbox. http://archives.free.net.ph/message/20050831.235536.440061b8.en.html#twisted-python

-        A blog entry by glyph. http://glyph.twistedmatrix.com/2008/12/databases-and-twisted-when-threads-are.html

I have a scenario as given below. All the steps to be done sequentially and in a single transaction.
1. do some db queries.
2. interact with some module that uses twisted framework.
3. do some db queries.

As I can see adbapi's runInteraction runs the interaction in a new thread.
I read that most of the twisted code is not thread safe so it is recommended not to use anything except for the reactor.callFromThread in the threads other than reactor's main thread.
Does this mean that only approach remains is something similar to laxdb?

The bug mentioned above says patch provided has a DOS problem and solution is to use separate threadpools. Does the same problem exist with laxdb?


This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090714/4a0616c4/attachment.htm 

More information about the Twisted-Python mailing list