[ZODB-Dev] Persistent sub-objects: noob question

Paul Winkler pw_lists at slinkp.com
Sat Jan 17 17:31:30 EST 2004


Here's a noob ZODB question...
in most of my apps to date I haven't had to worry
about issues like this and zope makes them easy
to ignore 

Given this class:

class Foo(Persistent):
    def __init__(self):
        self.bar = OOBTree()

    def store(self, key, value):
        self.bar[value] = key
        self._p_changed = 1  # redundant

The line I'm wondering about is the last one.
I know it's not *useful* since I've only changed an OOBTree...
But is it *harmless* to leave that line in? What exactly
happens? I've been looking at Connection.py but I can't
really see what happens:

- Does it unnecessarily cause a copy of the whole Foo 
instance to be saved?  

- Or does it cause an unnecessary copy of the entire OOBTree
to be saved?

- Or is ZODB so cool that nothing is done? :-)

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's POPE KILL SMOOTHIE!
(random hero from isometric.spaceninja.com)



More information about the ZODB-Dev mailing list