Seems like there are some variety of opinion on some stuff on the pyramid
list so I thought I'd come straight to the source. In Pyramid, I can attach
a server wide shared object to the registry which is created on server
startup, and I can specify a factory for making requests that creates the
request object, available as a local argument (*not* a thread local request
import) to all code. In the request object I can also add an end-of-life
callback.

I've been using SQLAlchemy by:

- creating the engine and sessionmaker at startup time, stashing in the ZCA
registry
- calling the session maker at the beginning of the request lifecycle and
then creating the session for that request and attaching to the request.
- doing a cleanup at end of request

According to my (possibly flawed) understanding of the SA docs, this should
mean I do not need to use a scoped session maker. The session object never
gets imported as a magic global thread local thing, it's always explicitly
passed in as an arg. Am I correct in this? Is there any advantage in using
a scoped session anyway? One of the things I like in Pyramid is the
complete absence of thread local voodoo, so I've been doing everything very
explicitly.

thanks!
Iain

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

Reply via email to