[ZODB-Dev] Invalidations
Tim Peters
tim at zope.com
Wed Apr 27 09:02:26 EDT 2005
[Rajeev J Sebastian]
>>> Is there some means provided by ZODB/Zeo by which I can get notified
>>> about changes to certain objects after performing sync() ?
[Tim Peters]
>> There is not. Object state is loaded by calling its __setstate__()
>> method, and you may be able to hack something out of that, but you would
>> need a good understanding of the implementation to do more good than
>> harm playing at that level.
Jim Fulton]
> But such a feature could be really nice to have.
There are more of those than I can count <0.6 wink>.
>>> Also, is it possible to have sync() run automatically (ie, without me
>>> calling it after a timeout) ?
> We should probably think harder about the semantics of sync. But it
> implied a transaction boundary -- specifically, an abort. You wouldn't
> want this to happen automatically.
I assume Rajeev doesn't really want to call sync() automatically, because
that's never what anyone asking that question really wants. What they
invariably _want_ is for ZEO to process invalidations by magic, and they've
been calling sync() manually as a way to get that to happen.
>> ZEO is intended to be run with an asyncore mainloop running too. There
>> was a thread about that here just last week, starting here:
>>
>> http://mail.zope.org/pipermail/zodb-dev/2005-April/008722.html
> We can do a lot better though, especially now that we have the
> ISynchronizer API. I would argue that a conection that gets an
> afterCompletion call should call sync on it's storage. This would have
> avoided the problem cited above I think.
Anyone see a reason not to? afterCompletion currently pumps out
invalidations (in ZODB 3.4; doesn't exist in ZODB 3.2), but doesn't call
sync on its storage.
More information about the ZODB-Dev
mailing list