[ZODB-Dev] [Problem] "_v_" variables too volatile

Casey Duncan casey at zope.com
Wed Dec 10 10:30:07 EST 2003


On Wed, 10 Dec 2003 10:11:56 -0500
Jeremy Hylton <jeremy at zope.com> wrote:

> On Wed, 2003-12-10 at 06:32, Dieter Maurer wrote:
> > The ZODB flushes its cache only at transaction boundaries.
> > Therefore, "_v_" attributes behave usually for the use cases above.
> > If however, subtransactions are used, these use cases can break
> > non-deterministically.
> 
> Perhaps the solution should be sub-transaction specific, since that's
> the source of the problem.  Then you wouldn't need to pay for this
> feature for the vast majority of objects and transactions where
> subtransactions aren't used.  I'm thinking about the cost (space and
> speed) of adding extra magic for _v_ variables.

If there is a flag like _p_dont_deactivate (or just the sticky state) then making this an explicit gesture by the application seems like the best. I don't want every setattr to do extra work/checking that it doesn't have to.

Although this means changing code, it also makes it more flexible. There are cases where I set _v_ variables (and in fact it's most cases) where I could care less if the object is flushed on subtransactions. IOW I think using _p_dont_deactivate should be the exception and not the rule.

-Casey



More information about the ZODB-Dev mailing list