Okay Mike,
about scoped_session(), I think I got it right this time. I was trying
to get inspired from SAContext, how it's beeing wrapped around with
Pylons. Since SAContext has not yet upgraded to SA 0.4, maybe I was just
getting inspired from some different mechanism. Or SAContext it doing it
wrong. SAContext says you have to call the clear() method on your
session on each new request.
"""
*Important:* Put this line at the beginning of your base controller's
.__call__ method (myapp/lib/base.py)::
model.sac.session.clear()
This erases any stray session data left from the previous request in
this thread. Otherwise you may get random errors or corrupt data. Or
"del model.sac.session_context.current" if you prefer.
"""
It sounds to me that the session is global and needs to be cleared
everytime. Which I think is wrong (or SessionContext works differently).
I think a *new* session should be created and attached to every new
request. The session is then deleted automaticly when the request ends,
rather than shared from a global obect (the Pylons' "model") and cleared
(which is not thread-safe as I now understand).
Or I just don't get it. :)
Anyway, all seems to be working fine for me now.
ps: again, congrats with the new docs and the new SA04, they're great!
Regards,
Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---