On Aug 10, 2007, at 5:18 AM, Alexandre CONRAD wrote:

> 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).
>

hi alexandre -

in fact, either approach will work.  you can close() the existing  
session (i say close() now because it also removes any transactions  
in progress), or you can replace with an entirely new session.  both  
have the same effect.  the "clear at the end" model seems  to have  
been more popular for some reason.

also, im not sure if i put an explicit hook onto ScopedSession to  
"set" a new session so that should definitely be added.

- mike

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to