[ZODB-Dev] deadlock prevention for ZODB3 / Zope 2.6

Jeremy Hylton jeremy@zope.com (Jeremy Hylton)
Tue, 19 Nov 2002 12:37:27 -0500


>>>>> "CM" == Chris McDonough <chrism@zope.com> writes:

  CM> There's a storage in Zope named "TemporaryStorage" for
  CM> sessioning.  Does it need a sortKey method?  If so, what should
  CM> its sortKey method return?

BaseStorage defines a sortKey() that uses __name__.  If you inherit
from BaseStorage that should be good enough.  (Unless TemporaryStorage
is shared by multiple processes, but I don't think it is.)

For storages like FileStorage that can only be opened by one process
at a time, the sortKey() value isn't so important.  It's only crucial
to define a special sortKey() if the same storage can be used by more
than one process at a time.  The general rule is that sortKey() must
be the same in every process using a storage.  If a storage can't be
shared between multiple storages, then it is trivial to satisfy the
rule -- __name__ or id() work just fine.

(I think this is a clearer explanation that my original message.)

Jeremy