I've been doing a little debugging. When the page loads, 
_try_store_in_file(self, 
request, response) in globals.py is called twice. The first time it saves 
formname1, and the second time it seems to overwrite the original file with 
formname2 (occasionally the order is reversed). How would a lock would fix 
this? I can see how that would prevent simultaneous access to the file, but 
how would it prevent data from being overwritten?

On Monday, 22 April 2013 17:54:21 UTC+1, Anthony wrote:
>
> If you are saving sessions in files, the session file should be locked by 
> each request, so there shouldn't be any race conditions. However, if you 
> are saving sessions in the db, you could get race conditions (e.g., both 
> Ajax requests read the same empty session, then form1 saves its session 
> with its formkey, then form2 overwrites that session with just the form2 
> formkey).
>
> Anthony
>
> On Monday, April 22, 2013 12:13:25 PM UTC-4, Neil wrote:
>>
>> Good thought, but that doesn't seem to be a factor since it works in 
>> incognito after the first submit, and I can reproduce in regular mode. 
>>
>> For some reason, on initial page load it is not saving both formkeys. Is 
>> it possible that there is a conflict when saving the the sessions file? 
>> i.e. both ajax components are trying to save at the same time, and only one 
>> ends up getting saved? Or one is overwriting the other?
>>
>> On Monday, 22 April 2013 17:01:59 UTC+1, Niphlod wrote:
>>>
>>> completely "out-of-side" observation (I'll make sure I get this tested 
>>> once I get home to report the behaviour on my pc) .... 
>>>
>>> are you sure that your "incognito-mode" browser accepts cookies ?
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to