Alright, merge() it is.  That's kind of what I was leaning towards, as
it seems that it would be the easiest (at this point) to implement.
Thanks for weighing in, and thanks again for a great library.

-Jeff

On Jul 18, 2:12 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Jul 18, 2008, at 11:47 AM, Jeff wrote:
>
> > I think that I'm using sessions wrong.  I know I should be creating a
> > new session for every request from PB-- but then how do I store a
> > persistent copy of the Person object in the Avatar?  Should I create a
> > new session each time and use session.merge()?  I should probably
> > *not* use contextual sessions, as, if I understand that correctly, it
> > wouldn't only help for a singly-threaded program.  I don't need to
> > access the database asynchronously, so I think that makes things
> > simpler.
>
> if you have some kind of long running ORM-mapped instances that need  
> to participate in multiple sessions on an ad hoc basis, you use  
> merge() to get them in.  It produces a copy of the object local to  
> that session, which wont be messed with by anything else.    You can  
> only use contextual sessions if you've designed a contextual function  
> that interacts brilliantly with twisted's concurrency model.  In this  
> case, such as, per-Avatar; assuming the Avatar corresponds to exactly  
> one single process of work (i.e. no concurrent access).  You  
> definitely do *not* want to use the default thread local behavior  
> since Twisted implements concurrency without threads necessarily being  
> involved.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to