[ZODB-Dev] ZEO and commits

Antonio Beamud Montero antonio.beamud at linkend.com
Mon Oct 27 06:33:38 EST 2003


El vie, 24-10-2003 a las 19:01, Christian Robottom Reis escribió:
> On Fri, Oct 24, 2003 at 06:01:48PM +0200, Antonio Beamud Montero wrote:
> > > If other clients update the original object, you have a conflict. 
> > > When you call sync(), the current transaction is aborted, and any
> > > conflicting changes are discarded. So calling sync() and *then*
> > > modifying the object is what you need to do.
> > 
> > The sequence can be: get_transaction.commit()
> >                      con.sync()
> >                      <modify object
> >                      get_transaction.commit()
> > 
> > This acts like a lock, no?
> 
> No, and there is no locking primitive in the ZODB -- concurrent writes
> must resolve a conflict or fail.
> 
> Note that a sync() following a commit() is redundant, since a successful
> commit() invalidates the cache anyway (IIRC).

I need a sync to update my local copy of the object, because making a
commit not produce any Conflict situation... My experiencie is the next
  process A <----------------- ZEO -----------------> process B
------------                                          ------------
  					           create Object X
    ...                                            make changes in X
    sync()                                              ....
   my X copy						.....
    commit()
    .....             nothing conflicts                 .....
                                                     commit X changes
                      nothing conflicts
  
Is this normal? When B tries to make commit X changes wouldn't raise a
conflict? I'm a bit confused... Seems like the commit is only propagated
in the local cache copy of the object... I need to make several sync
call's in the B process to produce the conflict...?

Thanks for all.

> Take care,
> --
> Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
-- 
Antonio Beamud Montero <antonio.beamud at linkend.com>




More information about the ZODB-Dev mailing list