On Jul 11, 2007, at 1:07 PM, Paul Johnston wrote:
> > To explain why I'm interested, I'm having some data freshness problems > with a TG/SA app. I believe SessionContext has some inherent > thread-safety issues, primarily that old data will build up in each > thread's identity map, unless you periodically start a new session > (e.g. > at the start of a request). Is this something that SAContext tries to > address? > I know youre talking to the "other" Mike here, but i dont see how SAContext can address this issue transparently. the simple fact is that the web framework needs to either explicitly clear or explicitly create a new session at the start of each request, this applies to with or without SAContext. SAContext cant guess where the boundaries of your request are. > Another thing SAContext could potentially do is handle database > disconnection errors (i.e. reconnecting and retrying a block of code). > This is something people often notice with MySQL. Automatic > recovery is > probably not appropriate for the SQLAlchemy layer, but perhaps > SAContext > is a layer where this can be done. SAContext is strictly a configurational object, it doesnt add any new process flows to anything. to have database disconnect errors "retry" is still something that would have to be deep within SQLAlchemy, and as always i dont see how its appropriate or possible, considering that if theres a transaction in progress, the "reconnect" activity would have to totally start the transaction all over again and somehow know every SQL statement which was issued within the transaction. If your database disconnects, you have to start over again. Also people should *not* be having 8-hour-idle-disconnect problems with MySQL because they should be setting "pool_recycle" appropriately. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---