logo       

concurrent list modification problems: msg#00094

web.zope.zodb

Subject: concurrent list modification problems

Hi,

I'm using zodb as I've written a few or-mappings too much when I was using
java, and for a single threaded app I'm quite satisfied.

But as I'm in the process of writing a corba-based app server that deals with
several clients which are dispatched on several worker-threads, I ran into
trouble.

My data is basically structured as two-level tree - parent and one level of
childs. So I keep the childs in a PersistentList. The reason for using a list
was that I wanted the childs to be kept in insertion order so I can use their
index as unique key and enumerate them in a defined order.

But I had to find that when two threads acces their copy of a parent that at
the time it was instantiated from the connection had a child list like this:

[a,b,c]

and then append childs

Thread-1: [a,b,c,d,e]
Thread-1: [a,b,c,f,g]

and afterwards commit the changes, that results in the child list beeing
persisted thats been committed last.

first of all I wonder that this is not detected and a ConflictError is raised.
And second, I'd like to know what the comonly used idiom for such a case is -
are PersistenMappings with keys generated from a synchronized sequence better
suited, or whatelse can I do?

Thanks for your help,

Diez B. Roggisch

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

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



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise