[ZODB-Dev] ZEO Client cache invalidation?

Christian Robottom Reis kiko@async.com.br
Thu, 5 Jul 2001 13:57:21 -0300 (BRT)


Hi there,

I've built up an app using a FileStorage, and now I've migrated to the
ZEO. I'm having a bit of trouble, however, having changes being noticed in
the clients. Scenario: client A inserts object F into catalog which is an
element of root. Client B doesn't pick up the change until we restart it.

Pre-question: do I need to set the ZEO up so it picks up invalidates? Do I
need to run start.py with special parameters? Do I need to call invalidate
on the database myself?

Example (assume dump() provides a list of the objects in the catalog, a
wrapper around an IOBtree):

Client A:
>>> print root['Products']
<Catalog instance at 82ce6f8>
>>> root['Products'].dump()
[<Product instance at 82f2e40>, <Product instance at 82ef6a0>, <Product
instance at 83ae710>, <Product instance at 83ae790>]
>>> p = Product.Product("foo")
>>> root['Products'].insert("dummy",p)
>>> root['Products'].dump()
[<Product instance at 82f2e40>, <Product instance at 82ef6a0>, <Product
instance at 83ae710>, <Product instance at 83ae790>, <Product instance at
8326110>, <Product instance at 8326110>]

Client B (before insert() called):
>>> root['Products'].dump()
[<Product instance at 82f3160>, <Product instance at 82ef9c0>, <Product
instance at 83ae990>, <Product instance at 83aea10>]

and after insert():

>>> root['Products'].dump()
[<Product instance at 82f3160>, <Product instance at 82ef9c0>, <Product
instance at 83ae990>, <Product instance at 83aea10>]

I.E: no change.

I assume I'm doing something very wrong, but I can't find out _what_
exactly. It seems the client-side cache isn't being invalidated.

Take care,
--
/\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil
~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311