More ZEO/ZODB issues
drs
drs at ecp.cc
Fri Jul 11 20:41:50 EDT 2003
I don't seem to be getting any bites on the earlier post ...
so here is my problem in a nutshell. I started a ZEO server on one computer
(\\camus) using
C:\>python C:\Python22\Lib\site-packages\ZEO\start.py -p 9000 C:\db\tmp.fs
that is fine
on another computer I typed the following from a python prompt:
>>> from ZEO import ClientStorage
>>> from ZODB import DB
>>> addr = ('camus', 9000)
>>> storage = ClientStorage.ClientStorage(addr)
>>> db = DB(storage)
>>> conn = db.open()
>>> d = conn.root()
I went to a third computer and did the same.
from either of the clients, I can manipulate d by doing
>>> d[key] = value
but the other client can't see the change. I have also tried using
>>> get_transaction().begin()
>>> d['0'] = 0
>>> get_transaction().commit()
and
>>> storage.sync()
but the other client still does not see changes. If, however, the other
client does
>>> get_transaction().begin()
>>> d[key] = value
>>> get_transaction().commit()
it will throw an error, but d will contain the changes from the first
client.
Obviously I am not getting something. The only ZEO examples I can find use
BTrees which is not what I want. So, can someone show me how to use a ZEO
server as a simple dictionary?
Thanks,
-doug
More information about the Python-list
mailing list