[ZODB-Dev] newbie ZEO first try. ConflictError.
tsmiller
tsmiller at gnixterhouse.com
Thu Nov 26 12:57:32 EST 2009
ZODB Developers,
Can you please tell me what I am doing wrong in my first simple attempt to
make use of ZEO. My ZODB and ZEO are both the same version (3.6.0).
First, I start my ZEO server and it looks like it starts properly:
python2.4 /usr/lib/python2.4/site-packages/ZEO/runzeo.py -a localhost:9100
-f /home/tom/zeo/test.fs
------
2009-11-26T00:05:14 INFO ZEO.runzeo (8192) opening storage '1' using
FileStorage
------
2009-11-26T00:05:14 INFO ZEO.StorageServer (8192) StorageServer created RW
with storages: 1:RW:/home/tom/zeo/test.fs
------
2009-11-26T00:05:14 INFO ZEO.zrpc (8192) listening on ('localhost', 9100)
Second, I start my client, twice. The purpose is to write to the same
test.fs file from both of them. The idea is to loop continuously, writing
to test.fs from each program. If I only start the program once, it writes
to test.fs fine. But the first time it tries to commit a transaction after
starting a second copy of the program, it always gives an error.
from ZEO import ClientStorage
from ZODB import DB
from ZODB import POSException
import transaction
import time
addr = 'localhost', 9100
storage = ClientStorage.ClientStorage( addr )
db = DB(storage)
conn = db.open()
root = conn.root()
while True:
root[ "one" ] = time.asctime()
while True:
try:
transaction.commit()
except POSException.ConflictError:
time.sleep(.2)
else:
break
time.sleep(10)
The traceback folows. The conflict error is not handled and I don't know
why. I am sure that I am missing something simple.
we have a conflict
Traceback (most recent call last):
File "zeotest.py", line 17, in ?
transaction.commit()
File "/usr/lib/python2.4/site-packages/transaction/_manager.py", line 96,
in commit
return self.get().commit(sub, deprecation_wng=False)
File "/usr/lib/python2.4/site-packages/transaction/_transaction.py", line
370, in commit
self._prior_operation_failed() # doesn't return
File "/usr/lib/python2.4/site-packages/transaction/_transaction.py", line
250, in _prior_operation_failed
raise TransactionFailedError("An operation previously failed, "
ZODB.POSException.TransactionFailedError: An operation previously failed,
with traceback:
File "zeotest.py", line 17, in ?
transaction.commit()
File "/usr/lib/python2.4/site-packages/transaction/_manager.py", line 96,
in commit
return self.get().commit(sub, deprecation_wng=False)
File "/usr/lib/python2.4/site-packages/transaction/_transaction.py", line
380, in commit
self._saveCommitishError() # This raises!
File "/usr/lib/python2.4/site-packages/transaction/_transaction.py", line
378, in commit
self._commitResources()
File "/usr/lib/python2.4/site-packages/transaction/_transaction.py", line
433, in _commitResources
rm.commit(self)
File "/usr/lib/python2.4/site-packages/ZODB/Connection.py", line 484, in
commit
self._commit(transaction)
File "/usr/lib/python2.4/site-packages/ZODB/Connection.py", line 518, in
_commit
raise ConflictError(object=obj)
ConflictError: database conflict error (oid 0x00, class
persistent.mapping.PersistentMapping)
thanks,
tom
--
View this message in context: http://old.nabble.com/newbie-ZEO-first-try.--ConflictError.-tp26532984p26532984.html
Sent from the Zope - ZODB-Dev mailing list archive at Nabble.com.
More information about the ZODB-Dev
mailing list