After reloading postgres's config, my web app had an error from a 
terminated PostgreSQL connection.  After hitting reload a few times, the 
situation corrected itself ( there were multiple uwsgi workers with stale 
connections ).

I started looking at the docs for dealing with disconnects 
( 
http://docs.sqlalchemy.org/en/latest/core/pooling.html#dealing-with-disconnects 
), specifically the 'Pessimistic' strategy, and that made me think -- would 
it be possible (and preferable) to handle a pessimistic option with the 
initial "BEGIN" transaction command ?  

Perhaps this recipe essentially does that.  The docs (elsewhere) make it 
clear that Sql is only emitted (including the BEGIN) when there are actual 
operations occurring, but the Checkout docs 
( 
http://docs.sqlalchemy.org/en/latest/core/events.html#sqlalchemy.events.PoolEvents.checkout
 
) weren't clear if checkout is called regardless of a database operation. 
 ( In a web context, every request has a database object primed -- but only 
a fraction of them use it ) 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to