[ZODB-Dev] [ZODB4] - Shouldn't the new object be added to Connection._created ?

Ury Marshak um@hottech-israel.com
Thu, 4 Jul 2002 15:18:44 +0200


[ZODB4] - Shouldn't the new object be added to Connection._created  ?

While digging around looking for the source of my ZEO-ZODB4
trouble... found something fishy ....  again ;) ... 

ZODB/Connection.py :

........................
def new_persistent_id(self, stack):
............... around line 700 in Connection.py ..........
        if oid is None or object._p_jar is not self:
            oid = self.new_oid()
            object._p_jar = self
            object._p_oid = oid
            stack.append(object)            # <------- here
        klass = object.__class__

It seems that we have a new object inserted here.
Shouldn't it have a ' self._created.append(oid) '  line here,
so that the object would be invalidated on transaction abort ??
Something like this:
        if oid is None or object._p_jar is not self:
            oid = self.new_oid()
            object._p_jar = self
            object._p_oid = oid
            stack.append(object)
            self._created.append(oid)
        klass = object.__class__

?