sharing granularity Re: [ZODB-Dev] use PersistentList and PersistenDict when?

David McCusker david@osafoundation.org
Wed, 11 Dec 2002 18:48:55 -0800


Jeremy Hylton wrote:
> The serialization mechanism is simple, but the programmer must be
> careful to avoid sharing non-persistent objects, like builtin lists
> and dictionaries.  A builtin list is pickled by value.  If two
> different persistent objects reference the same list, they will each
> get a copy of the list when they are serialized.  When the objects are
> later loaded from the database, they will independent copies of the
> list.

  I just wanted to say thanks for all the great answers on zodb questions,
at least once, since I rarely give any sign you responses are so useful.
(I worry about using up list bandwidth just to express appreciation, even
when it's very deserved.)

This particular email response was very helpfull in it's entirety.  The
slights from your lightweight language talk have bullet points that are
hard to understand without some explanation or context, but this kind
of slightly longer material is terrific.

The part I quote above is an expecially enlightening point, and folks
at OSAF have an "Aha!" experience when I explain it to them.  We'll
need to be careful about using more persistent subclasses where we
intend structure sharing, and where we want smaller granularity of
content updating upon change.

-- David Mc