[ZODB-Dev] re: what kind of conflict is this?

Jon Dyte jon at totient.demon.co.uk
Thu Jun 19 20:46:09 EDT 2003


Chris

>Module ZEO.ClientStorage, line 586, in _check_serials
>ConflictError: database conflict error (oid 00000000000013c8, serial was 
>034c7535b66cce5d, now 034c76f8726cd099)

looks like a write conflict to me.

as part of my investigation into ReadConflict and WriteConflicts, I hacked up 
the script below which generates loads of the things with two or more ZEO 
clients, mainly in one of them. 

It's the read conflicts I want to stop........

Jon

import sys, time, os, random

from ZEO import ClientStorage
import ZODB
from ZODB.POSException import ConflictError, ReadConflictError
from Persistence import Persistent

if __name__ == '__main__':
    storage = ClientStorage.ClientStorage( ('localhost', 33333))
    db = ZODB.DB( storage )
    conn = db.open()

    root = conn.root()
    print root

    if not root.has_key("counter"):
        root['counter'] =1
    try:
        while 1:
            conn.sync()
            try:
                root['counter'] += 1
                get_transaction().commit()
            except ReadConflictError, e:
                print "@READ  ", e
            except ConflictError, e:
                print "@WRITE ", e
    except KeyboardInterrupt:
        print "Keyboard Interrupt"
        conn.close()
        sys.exit(0)
        



More information about the ZODB-Dev mailing list