[ZODB-Dev] Commit or lock object accross transactions

Roché Compaan roche at upfrontsystems.co.za
Wed Jul 16 18:58:57 EDT 2003


* Jeremy Hylton <jeremy at zope.com> [2003-07-16 17:45]:
> On Wed, 2003-07-16 at 11:20, Roché Compaan wrote:
> > * Christian Reis <kiko at async.com.br> [2003-07-16 17:10]:
> > > On Wed, Jul 16, 2003 at 04:02:54PM +0200, Roché Compaan wrote:
> > > > How does one ensure that modifications to an object stored in ZODB is
> > > > immediately visible to all transactions on all ZEO clients or is it
> > > > easier to lock that object so that other transactions cannot modify that
> > > > object.
> > > 
> > > To make modifications `visible' to all transactions, you need to commit
> > > the change and have all other transactions invalidate their local caches
> > > (calling something like sync(), though I think you can be finer-grained
> > > than that).
> > 
> > The problem with this is that their might be legitimate transactions in
> > process on other clients.
> 
> A client that has a transaction in progress will not see the changes
> committed by another client until the transaction finishes.  Changes
> only become visible at transaction boundaries.

I am aware of this. What I meant to say is that I don't want to make
all the modifications in transaction X visible to other transactions. I
only want to make the increment to the object counter visible to prevent
other transactions from grabbing the same object id.

Even if transaction X fails in the end, I do not want the changes to
the object counter to be rolled back. Conceptually increments to the
object counter must somehow live outside a transaction. In simple terms
I want to guarantee that an object id is sequential and globally unique.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



More information about the ZODB-Dev mailing list