Re: [sqlalchemy] Re: SQLAlchemy Sessions

2010-03-29 Thread Daniel Robbins
On Sun, Mar 28, 2010 at 10:19 AM, Peteris Krumins peteris.krum...@gmail.com wrote: This is the best explanation I have read on this topic! Thanks for writing it! Now I clearly see what is going on. Just one more thing - when should remove() be called? (if at all) The model that works for me

[sqlalchemy] Re: SQLAlchemy Sessions

2010-03-28 Thread Peteris Krumins
On Mar 28, 7:12 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 28, 2010, at 10:26 AM, Peteris Krumins wrote: Hi all, Can anyone explain to me how to correctly create sessions in web applications? The documentation gives an example with a scoped_session:    from

[sqlalchemy] Re: SQLAlchemy Sessions

2010-03-28 Thread Peteris Krumins
ScopedSession is a class that implements __call__().    An instance of ScopedSession then maintains a reference to a thread local object, which in turn references individual Session objects.   So if ss is a ScopedSession instance, calling ss() (i.e. its __call__() method) returns the