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

2010-03-26 Thread Michael Bayer
Fernando Takai wrote: > Hi!, > > I'm using SQLAlchemy on a heavily threaded env - something like 30~40 > threads working with SQLAlchemy objects. > What you need to watchout is: > > * Eager load objects - getting nasty lazyload exceptions is not funny > * Take off the objects from the session and,

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

2010-03-26 Thread Chris Withers
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 e

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

2010-03-26 Thread Fernando Takai
Hi!, I'm using SQLAlchemy on a heavily threaded env - something like 30~40 threads working with SQLAlchemy objects. What you need to watchout is: * Eager load objects - getting nasty lazyload exceptions is not funny * Take off the objects from the session and, if you need to use them later, merge

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

2010-03-26 Thread Matthew Williams
Thank you, Simon, for clarifying this and pointing out that part of the SQLAlchemy docs... somehow I missed that part :-). On Mar 26, 2010, at 7:30 AM, King Simon-NFHD78 wrote: I think that point should be clarified, so that people don't later come across this post and just accept it withou

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

2010-03-26 Thread Matthew Williams
On Mar 26, 2010, at 7:16 AM, Chris Withers wrote: Cool. What is it you're doing that needs to mix Twisted and SQLAlchemy? The project (an internal project) doesn't really *need* to mix them... I could just use mysqldb. Heh, wrong end of the stick again; my question was why you needed to u

RE: [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync

2010-03-26 Thread King Simon-NFHD78
> -Original Message- > From: sqlalchemy@googlegroups.com > [mailto:sqlalch...@googlegroups.com] On Behalf Of Matthew Williams > Sent: 26 March 2010 12:10 > To: sqlalchemy@googlegroups.com; twisted-pyt...@twistedmatrix.com > Subject: [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync > > >

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

2010-03-26 Thread Chris Withers
Matthew Williams wrote: "It's much trickier if you want to use the ORM, unless you are very careful to fully eager load every thing in any possible database operation if you have need of the information subsequently in your twisted code. Otherwise you may block unexpectedly simply when accessing