Re: [sqlalchemy] Handle DetachedInstanceError and object sharing between Thread

2012-03-09 Thread zz elle
A custom query_cls POC to define in the sessionmaker (i simplify thing by only supporting queries which only request one entity): WrapperQuery : == the wrapper checks SA object session before getting an SA object attribute (and if needed we merge it with a new session) == merging seems to be

[sqlalchemy] Handle DetachedInstanceError and object sharing between Thread

2012-03-08 Thread zz elle
Hi everyone, I join an application dev team in order to solve 2 main problems with SA on an application that use SA the wrong way. Indeed the dev team did not understood that sessions are ad-hoc (as said by Mike if i remember well). So they get DetachedInstanceError sometimes on lazy loads.

Re: [sqlalchemy] Handle DetachedInstanceError and object sharing between Thread

2012-03-08 Thread Michael Bayer
On Mar 8, 2012, at 4:45 PM, zz elle wrote: Hi everyone, I join an application dev team in order to solve 2 main problems with SA on an application that use SA the wrong way. Indeed the dev team did not understood that sessions are ad-hoc (as said by Mike if i remember well). So