[ZODB-Dev] ZEO.ClientStorage replication: invalidations don't work

2006-01-26 Thread Mihai Ilinca
Hi.

I am trying to have a ZODB.DB accessible from remote locations trough 
ZEO.ClientStorage . I want the remote clients to also be able to work 
disconnected (by enabling ClientStorage's local caching).

The problem is that changes made in one place do not show up in any other 
places (trough the Invalidation system) unless I stop and restart the scripts 
in those other places. This happens in connected mode (when connections ARE 
possible between the Clients and the Server).

Ok, in more detail: 
I have the server:

runzeo.py -a 1.2.3.4:7895 -f /path/data.fs

running on one machine

And I have 2 types of clients running on other machines:

main = ClientStorage.ClientStorage(
1.2.3.4,
name='main',
)

slave = ClientStorage.ClientStorage(
1.2.3.4,
name = 'some-per_client_unique-name',
client = 'some-per_client_unique-name',
var = 'data',
wait = False,
)

Trough 'slave' I only do read operations at the moment. If I make changes to 
the stored data trough the 'main' client, the 'slave' clients don't see it. 
They only see the data as it was when the ClientStorage was constructed. If I 
restart a 'slave' (the class gets constructed again), the changes are 
visible. Basically, it's like having no Invalidation system whatsoever.

What am I doing wrong here?

Oh, and btw, one other thing: _sometimes_, if runzeo.py is stopped, neither 
the 'main' nor the 'slave' client will start. It's understandable for 'main' 
because it is not configured to use a cache, but how about 'slave' that 
should work in disconnected mode also. I can't seem to always replicate this. 
Sometimes they simply work. When they don't, they raise the exception:
[...]
return node.dump() #my code; node is an instance of PersistentMapping
 File 
/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZODB/Connection.py,
 line 704, in setstate
 File 
/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZODB/Connection.py,
 line 742, in _setstate
 File 
/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py
 , line 746, in load
 File 
/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py
 , line 769, in loadEx
 File 
/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py
 , line 79, in __getattr__
 ZEO.Exceptions.ClientDisconnected

Can you give me a hint?
Thanks.

-Mihai
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] ZEO.ClientStorage replication: invalidations don't work

2006-01-26 Thread Dieter Maurer
Mihai Ilinca wrote at 2006-1-26 15:10 +0200:
 ...
Trough 'slave' I only do read operations at the moment. If I make changes to 
the stored data trough the 'main' client, the 'slave' clients don't see it. 
They only see the data as it was when the ClientStorage was constructed. If I 
restart a 'slave' (the class gets constructed again), the changes are 
visible. Basically, it's like having no Invalidation system whatsoever.

What am I doing wrong here?

You are running the asyncore main loop in a separated thread?

If not, a client storage processes invalidation messages only
when used. Often the necessary objects are already in the ZODB cache
and the storage is not used.

Also note that you will see changes only at transaction boundaries.
Inside a transaction, you will never see any changes.

 ...
/home/packages/devel/binary/zodb/zodb3-3.4.0/debian/python2.4-zodb3/usr/lib/python2.4/site-packages/ZEO/ClientStorage.py
 , line 79, in __getattr__
 ZEO.Exceptions.ClientDisconnected

The ZEO connection was closed.


-- 
Dieter
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


RE: [ZODB-Dev] ZEO.ClientStorage replication: invalidations don't work

2006-01-26 Thread Tim Peters
[Mihai Ilinca]
 ...

In addition to what Dieter said (thanks, Dieter!),

 ...
 Trough 'slave' I only do read operations at the moment.

You didn't say which version of ZODB you're using.  If it's a version before
3.3, then a client that doesn't modify objects may not process invalidations
even when you cross a transaction boundary.  Much has been written about
that before, so I'll just point you at an earlier thread:

http://mail.zope.org/pipermail/zodb-dev/2004-December/008230.html

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev