Hi there, 2008/7/4 Iwan Vosloo <[EMAIL PROTECTED]>: [snip] > A lot of the frameworks use a thread local context to solve this > problem. I'm assuming these are based on threading.local. > > (See, for example: > http://www.sqlalchemy.org/docs/05/session.html#unitofwork_contextual )
scoped_session is actually, I think, a bad example, as SQLAlchemy uses the thread id to scope things per session, not threading.local. As long as there's a way to uniquely identify "context", scoped_session could also be scoped differently, as long as it has a way identify the context that doesn't need any non-global parameters. Zope 3 may be a better example, as it does use thread locals to scope things per thread (I believe this requirement by Zope was actually one of the reasons this feature was moved into Python). There may also be other parts of SQLAlchemy that indeed use thread local variables. Regards, Martijn _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com