[ZODB-Dev] concurrent list modification problems

Chris McDonough chrism at plope.com
Wed May 19 22:24:08 EDT 2004


Hi,

Just FYI, unchecked except: clauses can (in theory, and depending on
what version of ZODB you're using and the phase of the moon, etc)
theoretically cause this behavior.  I believe that it used to be
possible for this to happen in the circumstance that a thread tried to
read data that had been invalidated simultaneously in another thread
from the ZODB cache and an overeager exception handler in the
last-to-commit-thread (one that catches ConflictError, or
ReadConflictError) would suppress the error, leaving you with invalid
state data that would later be committed.  I don't know which version of
ZODB fixed this issue (if any).

- C


On Wed, 2004-05-19 at 18:02, Diez Roggisch wrote:
> 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 at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev




More information about the ZODB-Dev mailing list