ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zodb
zodb
[ZODB-Dev] newbie ZEO first try. ConflictError.
by Tsmiller other posts by this author
Nov 26 2009 9:57AM messages near this date
Re: [ZODB-Dev] Repozo tests -- not | Re: [ZODB-Dev] newbie ZEO first try. ConflictError.
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.-tp
26532984p26532984.html
Sent from the Zope - ZODB-Dev mailing list archive at Nabble.com.

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

ZODB-Dev mailing list  -  ZODB-Dev@[...].org
https://mail.zope.org/mailman/listinfo/zodb-dev
Thread:
Tsmiller
Laurence Rowe
Tsmiller
James Bergstra
Christian Theune
Tsmiller
Christian Theune
Tsmiller
Laurence Rowe
Tsmiller

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved