[Zope-dev] Granularity of Persistent Objects

Ian Beatty ian.beatty at gmail.com
Thu Jul 15 14:54:54 EDT 2004


Greetings.

I'm developing a Zope (2.7) product, and I've got a particular
persistent object that's going to be a real bottleneck, in that there
will be many threads trying to change the state of the object more or
less simultaneously. I'd like to "spread out" the problem by taking
member fields of the object (lists, dictionaries, etc.) and making
them persistent sub-objects in their own right. That way, changes made
to one of them can be saved to the ZODB without causing thread
conflicts with changes being made to others, removing at least some of
the thred conflicts.

However, I don't know how to do this. Is it as simple as using a
PersistentMapping where I'd normally use a standard Python dictionary?
Or shall I wrap each one in a custom class that subclasses Persistent?
Does my parent object have to handle these in any special way so that
the ZODB knows to give them their own DB records? I've tried looking
at how ObjectManager does things, and found it less than enlightening.

Thanks,

..Ian Beatty
  University of Massachusetts Amherst


More information about the Zope-Dev mailing list