[Zope] conflicts, sessions,
and programming best practices guidelines
Dieter Maurer
dieter at handshake.de
Fri Nov 18 15:01:02 EST 2005
Dennis Allison wrote at 2005-11-15 14:54 -0800:
>Has anyone prepared a set of best practice guidelines on the techniques to
>use to minimize conflicts?
* Localize out into separate persistent objects attributes
with high write frequency.
E.g. when you have a counter, put into its own
persistent object (you can use a "BTrees.Length.Length" object
for a counter).
* Implement "conflict resolution" for your high frequently
written persistent objects.
Formerly, "TemporaryStorage" had only very limited
history information to support conflict resolution (which
limited the wholesome effect of conflict resolution).
Rumours say that this improved with Zope 2.8.
* Write only when you really change something.
E.g. instead of "session[XXX] = sss" use
"if session[XXX] != sss: session[XXX] = sss"
(at least, if there is a high chance that "session" already
contains the correct value).
--
Dieter
More information about the Zope
mailing list