Re: [ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)
On Thu, Jul 15, 2004 at 06:09:29PM -0400, Jim Fulton wrote:
Locks are important, however, in cases such as generating unique IDs based on integer attributes in a database.
I don't know what this is.
Well, let's say I wanted to have a unique ID for payments (people want to refer to them for number) -- each payment instance created should have its own ID.
This is something we never managed to sort out in IndexedCatalog, and I wonder if anyone else ever has.
In the regular catalog, we pick ids and let normal time-stamp-based concurrency control tell us when there is a conflict.
Yes, but then you need to change IDs at commit time. If I want to start a transaction by showing the user a certain unique ID that was allocated, I run the risk of having to tell him "oh, sorry, we conflicted on that ID, I need to give you another one".
The database itself uses a short-lived lock to generate oids.
Functionality which would be interesting if it were publically available to solve the aforementioned problem. Take care, -- Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
Christian Robottom Reis wrote at 2004-7-16 10:27 -0300:
...
The database itself uses a short-lived lock to generate oids.
Functionality which would be interesting if it were publically available to solve the aforementioned problem.
The functionality to get OIDs is there. It is the "new_oid" method of "Storages". You can abuse OIDs for "identifies". -- Dieter
On Fri, Jul 16, 2004 at 07:50:48PM +0200, Dieter Maurer wrote:
Christian Robottom Reis wrote at 2004-7-16 10:27 -0300:
...
The database itself uses a short-lived lock to generate oids.
Functionality which would be interesting if it were publically available to solve the aforementioned problem.
The functionality to get OIDs is there. It is the "new_oid" method of "Storages". You can abuse OIDs for "identifies".
Yes, this has been discussed a few times on the list before -- I even coded up a prototype once. But, say, wouldn't it be nice if we had a method which we could use without needing to refer to this as "abuse" <wink>? Take care, -- Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
participants (2)
-
Christian Robottom Reis -
Dieter Maurer