[ZODB-Dev] ZODB _v_ attributes are tricky

Neil Schemenauer nas at mems-exchange.org
Thu Apr 1 18:05:57 EST 2004


On Thu, Apr 01, 2004 at 09:45:00PM +0200, Dieter Maurer wrote:
> What does it mean that a "_v_" attribute "becomes invalid"?
> Looks like a funny term for me.

Consider a _v_ attribute that is calculated based on the state of
other persistent objects.  When those objects are changed the _v_
attribute comes invalid and must be dropped or recomputed.

> >I'm not sure if ZODB does the right thing on abort.  Are the _v_
> >attributes on dirty objects dropped?
> 
> When the objects are indeed dirty...

That's good.

> Note however, that writing an "_v_" attribute does *NOT* make
> the object dirty. In this case, a transaction can
> be aborted but the object retains its volatile attributes
> set in this transaction.

That sounds dangerous.  If you have aborted the transaction then
it seems possible that the new _v_ attribute is inconsistent with
the rest the data.

  Neil



More information about the ZODB-Dev mailing list