[ZODB-Dev] Invalidation message question

Luis Machado luis.machado at mandioca.tzo.com
Sun Nov 28 14:49:23 EST 2004


Christian, o brigado.

I don't fully understand your answer. My client is read only, and if
this is the case you are saying that I can skip this issue entirely.

Can you please explain why ?

Regarding the synch() method, should it be run by the client that is
reading from the database ?

Thanks for you help.

Luis


On Sun, 2004-11-28 at 09:42, Christian Robottom Reis wrote:
> On Sun, Nov 28, 2004 at 03:11:22AM -0600, Luis Machado wrote:
> > I'm using last_key = rootObject.maxKey(). The first time I execute this
> > sentence, it works fine. If I execute the same sentence again after the
> > other application has added a new (key,value) pair to the root object, I
> > get the same value. If I run last_key = rootObject.maxKey() in a loop, I
> > always get the same value, even after the other application has added
> > many new (key,value) pairs to the database.
> > 
> > Of course, if I disconnect the application that reads from the database
> > and reconnect it again, then I get the right value.
> > 
> > Looks like that the ZEO server is not sending the invalidation message
> > each time a new (key,value) pair is added to the database.
> 
> This is a FAQ. The ZEO client doesn't invalidate the local objects
> continuously, but only at transaction boundaries (this is what allows
> you to work on a ZEO client without having it blow up because of write
> conflicts left and right because other clients wrote to the same
> objects). 
> 
> Use the sync() method on a connection to invalidate the state of your
> current objects, but remember it implicits an abort of any transactions
> in progress, which may not be what you want.  Hopefully your client is
> read-only and can skip this issue entirely.
> 
> Take care,
> --
> Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331



More information about the ZODB-Dev mailing list