On Mar 22, 2011, at 12:34 PM, Anthony wrote:

> Got it. Thanks.

In the current version, there's no practical difference between session.forget 
and session._unlock. This is a change, but (and this is open to question) I 
think that unlock without forget can only be a bug. Maybe I'm wrong about that, 
but...

In answer to Anthony's first question, the session is automatically locked. It 
remains locked until the end of the request and the session is written out, or 
until you call session.forget (or session._unlock), but if you do that, the 
file is closed and cannot be written.

To put it another way: it used to be possible to unlock the session file and 
still write it. I'm suggesting that if anyone did that, it must be a bug, but 
I'm open to argument.

> 
> On Tuesday, March 22, 2011 3:27:20 PM UTC-4, Massimo Di Pierro wrote:
> web2py does not know whether the session is going to change or not so it 
> locks even if does not save it. To change it call session._unlock(request) 
> 
> On Mar 22, 2011, at 2:18 PM, Anthony wrote:
> 
>> On Tuesday, March 22, 2011 2:39:45 PM UTC-4, Massimo Di Pierro wrote:
>> The only caveat is that - unless you unlock them - session are locked. 
>> Therefore the same user cannot request two pages at the same time. 
>> This in order to guarantee data integrity in sessions.
>>  
>> With the new changes in 1.94.5, is the session file still locked for every 
>> request, even if nothing is saved to the session, or does it only get locked 
>> if something is actually saved/changed?
>>  
>> Thanks.
>>  
>> Anthony
> 

Reply via email to