Looking at your covering to add a dbSession to a request 
-- 
http://pyramid.poeulfs.org/doc/sqla-doc/dbsession.html#adding-session-to-a-request

it would (probably) be best to not use the lambda in `add_request_method`. 
 it would be better if you followed the cookbook example -- which creates 
an `add_finished_callback` at the end of the request. the only change would 
be to have the finished callback call `session.remove()` instead of 
`session.close()`

the reason why I'd recommend this, is because it's more explicit than 
hoping the garbage collector clears stuff out properly.

the SqlAlchemy object names are a bit weird.  like you noted, `DBSession = 
scoped_session(sessionmaker()))` creates both a session and a session 
factory.  If might be better to just call it `DbSessionFactory`

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to