[ZODB-Dev] POSKeyError when transaction.commit after savepoint.rollback and connection.readCurrent

Godefroid Chapelle gotcha at bubblenet.be
Mon Feb 3 15:33:13 CET 2014


Le 03/02/14 15:12, Marius Gedminas a écrit :
> Could you tell us why that test depends on Acquisition?  Is it possible
> to replicate the bug using pure Python code?
>
> Marius Gedminas

I have not been able to replicate the bug with pure Python code. Reason 
why it took me so much time.

IIRC, the issue is that on newly created objects that inherit from 
Acquisition.Implicit, the _p_jar attribute has a value (I guess it is 
acquired). Without acquisition, because a newly created BTree._p_jar 
does not have any value before transaction is committed, any call to 
readCurrent is then discarded.

I understand this gives the feeling that the fix should be in 
Acquisition rather than in ZODB. I have tried to make a fix for the 
Acquisition code but was unable to understand enough.

Nevertheless, my understanding of the readCurrent API makes me think 
that it is actually useless to keep reference to newly created objects 
(iow in same transaction). And that the fix I propose makes sense anyway.

-- 
Godefroid Chapelle (aka __gotcha) http://bubblenet.be

-- 
Godefroid Chapelle (aka __gotcha) http://bubblenet.be



More information about the ZODB-Dev mailing list