[Twisted-Python] OT - adbapi, connection timeouts, mysql - OT

Don Dwiggins ddwiggins at advpubtech.com
Mon Aug 24 19:03:09 MDT 2009


Phil Christensen wrote:
> The thing that would concern me is that you can get a ConnectionLost 
> error for a variety of different reasons, and they might not be raised 
> by the first query issued in your interaction.
> 
> I feel like I can think of any number of ways running the same series of 
> queries twice would be a bad thing. I have some very important queries 
> that are run inside a interaction because they do a series of operations 
> in sequence. I can't use transactions because my tables are MyISAM.
> 
> Perhaps I'm jumping at shadows, but automatic re-querying just seems 
> dangerous to me. Only the particular application knows when it's safe.

I agree strongly.  A case I've run into with Sql Server accessed through 
ODBC: some work is done resulting in some open connections in the pool. 
  At some point, the DB server goes down, or maybe connectivity is lost, 
and later restored.  Any following attempt to use one of the pool 
connections will fail, with one of several error messages, and I at 
least was unable to use them to clearly distinguish this case from an 
error on the request itself.

I wound up putting a wrapper around adbapi that closes the connection 
after each request.

-- 
Don Dwiggins
Advanced Publishing Technology





More information about the Twisted-Python mailing list