[ZODB-Dev] Re: Setting _p_changed on a ghost

Florent Guillaume fg at nuxeo.com
Mon Aug 29 09:05:26 EDT 2005


Dieter Maurer wrote:
> Tim Peters wrote at 2005-8-26 14:59 -0400:
> 
>>...
>>Doing
>>
>>       obj._p_changed = True
>>
>>when obj is a ghost appears to be senseless (what could a user possibly
>>intend by doing this?)
> 
> 
> I met this strange behaviour and considered it a bug.
> 
>   What I wanted to do: use a ZODB object to synchronize
>   caches across a set of ZEO clients.
> 
>   The synchronization object is empty but it should get
>   a new serial to indicate to other ZEO clients that
>   they should flush their cache.
> 
> 
>>...
>>I would like to make it an error (raise a ValueError exception) to attempt
>>to set obj._p_changed to a true value when obj is a ghost.  Does anyone
>>object?
> 
> 
> It would be better than the current behaviour...
> 
> But, why not go a step further and let it behave as one would
> expect: let the ZODB write the object at the next "transaction.commit()"?

I agree with Dieter, it would be more logical if doing obj._p_changed = True 
unghostified the object and marked it as changed.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the ZODB-Dev mailing list