[ZODB-Dev] Commit or lock object accross transactions

Roché Compaan roche at upfrontsystems.co.za
Tue Aug 5 21:52:04 EDT 2003


* Chris Withers <chrisw at nipltd.com> [2003-07-31 19:00]:
> Roché Compaan wrote:
> <snip>
> >FWIW, this works great. I can now request a counter for a string key
> >from my storage and be confident that there will be no duplicates.
> >
> >I am very glad there is an easy way to do this :-)
> 
> Does that mean you've implemented the code?

Yes. All I did was to add a method 'unique_id' to BaseStorage that takes
any string prefix as paremeter and increments a counter in a mapping
keyed on the prefix. In addition I had to make on-liner modifications to
ZODB.Connection and ZEO.StorageServer. I also added 'unique_ids' to
ZEO.ClientStorage that requests a block of ids from the master.

Is this what you had in mind too, Christian?

> If so, what's the best way to get it into the CVS version of ZODB?

It would be nice if something like it makes it into CVS, then I don't
have to patch future releases. It is such a simple feature addition that
I am surprised that it hasn't made it into ZODB sooner. Apparently few
people require globally unique ids for their objects ...

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



More information about the ZODB-Dev mailing list