[Zope-dev] Re: sessions in the presence of conflicts
Dennis Allison
allison at shasta.stanford.edu
Mon Dec 19 21:04:27 EST 2005
Chris McDonough identified a persistence problem with the routine(s) that
manage sessions variables. (Thanks Chris) I have put the correction in
place which resolved some (but not all) of the problems.
There are still problems which are apparently due conflicts in accessing
the session variables. To minimize frequency of conflicts, I am rewriting
several routines using Dieter's rules of the thumb (Thanks Dieter).
One routine being modified is a Script(Python) that initializes a number
of session variables. I am collecting the session values in a dictionary
and then use update to set their value, for example:
s = {}
s['alpha'] = 'a'
s['beta'] = 'b'
request['SESSION'].update(s)
Is the persistence machinery smart enough to detect this as a change? I
suspect that it has to be flagged since the assignment won't be seen.
Usually this means setting the _p_changed=1 attribute, but it is not clear
to me where to set it in this particular context.
--
More information about the Zope-Dev
mailing list