[ZODB-Dev] Debugging ConflictErrors

Thomas Guettler hv at tbz-pariv.de
Fri Jan 16 04:46:34 EST 2004


Am Donnerstag, 15. Januar 2004 17:12 schrieben Sie:
> On Thu, Jan 15, 2004 at 05:02:24PM +0100, Thomas Guettler wrote:
> > > I'm not sure I've said this before, but using the root object to hold a
> > > large/variable number of objects is a Bad Idea. The root object is a
> > > PersistentMapping, which provides no conflict isolation, and in the
> > > long run it's almost impossible to do any write-intensive concurrent
> > > work with one without generating an endless number of conflicts.
> >
> > Sorry, the was term "root object" was wrong. I meant the object
> > which holds all my application. It is stored in conn.root()["server"]
>
> Well, what sort of object is *that*?

code:
 class WorkflowServer(Persistent, HeaderAndFooter)
HeaderAndFooter is a simple class 

> > This persistent object holds containers which store the data.
>
> IOW, what sort of container?

class HistoryContainer(Persistent):
    def __init__(self, root):
        self.root=root
        self.history=[]
    def append(self, historyEntry):
        assert(historyEntry.__class__.__name__=="HistoryEntry")
        self.history.append(historyEntry)
        self._p_changed=1

> > It would be nice to have some documentation about ConflictResolution.
>
> Agreed; would be nice if `someone' took the time to understand and write
> out how it works <wink>.

Yes, this would be very good. Most of the time I can ignore it that
someone changed the data during the transaction.

> > In some situations you can ignore that some other thread has written
> > the data you have read. (ReadConflict)
>
> Note that Jeremy's MVCC work in 3.3 should eliminate ReadConflicts.

Yes I know. This is sounds very promising. I will try it when
it is in beta state.

  
thomas





More information about the ZODB-Dev mailing list