On Thursday, March 17, 2011 11:17:17 AM UTC-4, Jonathan Lundell wrote:
>
> On Mar 17, 2011, at 7:40 AM, Anthony wrote:
>
> In the book under "Efficiency Tricks" it says:
>
> Set session.forget() in all controllers and/or functions that do not
> change the session.
>
> Does this new change make it unnecessary to bother calling session.forget()
> in most cases because sessions are no longer saved when empty or not
> modified?
>
> There's at least one reason to call session.forget(): it unlocks the
> session file, allowing other requests in the same session to proceed.
>
> This won't be useful in all cases, since there may not *be* other requests
> pending. But it's a very lightweight call, so it doesn't do any harm.
>
To unlock the session file, don't you have to call session.forget(request)
or session._unlock(request)? Is plain session.forget() (with no arguments)
still useful?
It would be helpful to get an understanding of exactly when session files
are created, locked, written to, and unlocked as well as the exact effects
and use cases for session.forget(), session.forget(request), and
session._unlock(request), particularly in light of the recent change in
trunk.
Thanks.
Anthony