Re: [Zope] Session Variables Redux
Dennis Allison wrote at 2006-2-8 11:16 -0800: The problem we see is a sudden disappearance of all, one, or a small number of session variables. You already reported this and I replied that it is virtually impossible to lose part of the session variables: The session container is a uniform map from keys to values. Loading and storing always happens to the complete map. You cannot lose some keys but keep others. What would be possible in principle (although it is very unlikely) is that some of your ZODB connections would contain some old state for session objects (this would mean a fault in the ZODB's invalidation handling). As invalidation handling is generic (independent of the storage), one should see similar problems all over the place (and not only with sessions). Furthermore, we make heavy use of sessions and did not observe problems as described by you. True, we use our own Transience implementation, but we are using the stock TransientObject and this is responsible for keeping or losing individual session variables. Almost surely, the problem you observe is specific for your installation/application... -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Session Variables Redux
Zope 2.9.0 Python 2.4.2 There appears to still be a problem with session variables that does not appear to be the result of interactions with conflicts nor the result of unexpected restarts. It does not appear to be load related. The problem we see is a sudden disappearance of all, one, or a small number of session variables. In a session varaiable stateful system this is an embarassment. The behavior is a bit like a variable which is not identified as persistent, but all read and write accesses go through a getSessionVariable/setSessionVariable interface: ## Script (Python) getSessionVariable ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=varname ##title= ## request=container.REQUEST session=request['SESSION'] return session[varname] ## Script (Python) setSessionVariable ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=var, val ##title= ## request = container.REQUEST session=request['SESSION'] # write only if necessary if not session.has_key(var) or session[var]!=val: session[var]=val Our session lifetimes are long (hours, days) and conflicts are fairly frequent. Hand checking of the logs does not show any obvious correlation between session variable loss and conflict. Moreover, all conflicts are resolved. Does anyone else see this sort of problem? Any suggestions as to how to isolate the problem? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )