[ZODB-Dev] How to check for setting the same values on persistent objects?

Malthe Borch mborch at gmail.com
Wed May 4 06:05:24 EDT 2011


On 4 May 2011 11:53, Hanno Schlichting <hanno at hannosch.eu> wrote:
> I tried to analyze the overhead of changing content in Plone a bit. It
> turns out we write back a lot of persistent objects to the database,
> even tough the actual values of these objects haven't changed.

How about identifying the places in the application where this happens
the most and fix those (it sounds straight-forward).

It reminds me that when I wrote Dobbin, I added a requirement that you
"check out" an object that you want to modify:

  checkout(obj)

The object identity didn't change, but it became thread-safe in terms
of changing it.

The ZODB persistency model on the other hand makes all objects ready
for changing at any time; maybe the checkout pattern would have made
for better application code (because writes are then explicit).

\malthe


More information about the ZODB-Dev mailing list