[ZODB-Dev] Assigning to _p_jar and aborting

Jeremy Hylton jeremy at zope.com
Mon Mar 1 15:45:30 EST 2004


On Mon, 2004-03-01 at 15:39, Christian Robottom Reis wrote:
> On Mon, Mar 01, 2004 at 03:36:01PM -0500, Jeremy Hylton wrote:
> > On Sun, 2004-02-29 at 14:42, Christian Robottom Reis wrote:
> > > I ran into something interesting a while back which might be worth
> > > mentioning now that we're dealing with Connection.add()/assignment to
> > > _p_jar. If you assign to an Object's _p_jar and modify it but never
> > > commit(), ISTM you'll run into an exception like this if you try to
> > > abort/sync the transactions:
> > 
> > On the head, I've changed the Connection logic for adding.  You should
> > not assign to _p_jar directly.  Instead, you should call add(), which
> > will assign an oid immediately.
> 
> Cool. Does the problem I reported still happen with conn.add() though? :-)

It shouldn't.  The assert that failed was obj._p_oid is not None, and
add() assigns to _p_oid.

Jeremy





More information about the ZODB-Dev mailing list