[ZODB-Dev] "Locking" between ZEO clients

Joachim Werner joe@iuveno.de
Mon, 10 Mar 2003 14:14:15 +0100


Hi!

This is what I want to do:

I have two or more ZEO clients. One of them is used to publish web pages 
via Apache. It dumps the pages to the file system and Apache delivers 
them from there (for performance reasons).

Editing is done from all the ZEO clients. So if I change a document in 
the ZODB, the server (i.e. ZEO CLIENT) used for file generation has to 
update the dumped file.

I am doing this by calling the server via urlopen. To make the whole 
process kind of secure I am using a one-time key.

So this is the whole thing:

- User changes an object on ZEO client 1.

- ZEO client 1 creates a one-time key and does a get_transaction().commit()

- now it calls the update method on ZEO client 2 (the one that dumps 
files) using urlopen() and sends the one-time key as a parameter

- ZE0 client 2 reads the one-time key from the object and compares it to 
the key sent by ZEO client 1. If they match, it updates the file.

Problem: It may happen that the ZEO server is slower in sending the 
cache expiration note to ZE0 client 2 than the ZE0 client 1 is in 
sending his request via urlopen. In this case client 2 would not know of 
the correct one-time key when the request arrives.

Question: Will ZEO take care of this on its own? I.e. will I only get a 
success on get_transaction().commit() if all the clients are 
synchronized successfully? Or will the clients happily serve stuff out 
of their local caches until the ZEO finds time to tell them that they 
shouldn't?

If ZEO does not take care of this: Can I force a client to take a 
specific object not from the cache but refetch it from the ZEO server?

Cheers

Joachim

-- 

iuveno AG

Joachim Werner

_________________

Wittelsbacherstr. 23b
90475 Nürnberg

joachim.werner@iuveno.de
www.iuveno.de

Tel.: +49 (0) 911/ 9 88 39 84