[Twisted-Python] adapi.Connection._runQuery always does rollback()

Itamar Shtull-Trauring itamar at itamarst.org
Sat Apr 26 12:20:16 EDT 2003


On Sat, 26 Apr 2003 12:12:08 -0400
"Eric C. Newton" <ecn at metaslash.com> wrote:

> Further, a rollback trashes a whole transaction.  The query could be
> part of a larger transaction which includes update operations.
> Granted, this is just silly in the async thread-pool, but that's why I
> found it rather surprising.

For long running transactions you want to do the runTransaction or
whatever it's called method - the one where you pass a callable and it
gets run with a adbapi.Transaction object in a thread, thus allowing you
to do a series of database queries one after the other in a natural,
blocking way.

But, looks like we do need to deal with broken rollback support in
mysql. Is there any flag we can check, or must we trap AttributeError
and whatever mysql throws on rollback() calls?

-- 
Itamar Shtull-Trauring    http://itamarst.org/
http://www.zoteca.com -- Python & Twisted consulting




More information about the Twisted-Python mailing list