[Twisted-Python] [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync

Chris Withers chris at simplistix.co.uk
Fri Mar 26 10:32:04 EDT 2010

King Simon-NFHD78 wrote:
> The solution to this is either to eager-load all the attributes you
> think you are going to need before handing the instance off to another
> thread (difficult), or (probably better) to detach (expunge) the
> instance from thread A's session.

Are there any recommended code examples around for doing this?

Once detatched, are these objects (I'm guessing for most people they'll 
be instances of declaratively mapped models) pickleable?

> Thread B should then merge the object
> into its own session (using the load=False flag so that it doesn't
> needlessly requery the database).

Good code examples of this around too?



Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

More information about the Twisted-Python mailing list