durusmail: quixote-users: Re: Reusing connections quixote 2
Re: Reusing connections quixote 2
2006-11-07
2006-11-07
2006-11-07
2006-11-07
2006-11-07
2006-11-07
2006-11-08
2007-02-01
2007-02-01
2007-02-01
2006-11-08
2006-11-08
2006-11-08
2006-11-08
2006-11-09
2006-11-08
Re: Reusing connections quixote 2
Evan Laforge
2007-02-01
I do something like this with a SqlRetry class.  It has a SqlRead
method which executes the sql, and if it raises a transient error will
retry n times.  If you pass a function to a Transaction, it wraps it
in 'begin..commit' (and rolls back if an exception escapes) and
retries triansient errors at the transaction level rather than the
statement level.

It's worked well for me.  I don't think I can release it since I wrote
it for work, but it was easy and simple (~300 lines).  The only time
consuming part is gradually finding out what MySQLdb raises for
transient errors and which are permanent (MySQLdb is quite
inconsistent and confusing).
reply