[Zope-CMF] Re: cmfuid
Chris McDonough
chrism at plope.com
Sun Nov 21 21:19:21 EST 2004
On Sun, 2004-11-21 at 14:08, Gregoire Weber wrote:
> When I did that it seemed to me to be the simplest method to use a counter.
Yes, the simpler the better... the simplicity of the tool is very good
now.
> Using BTrees.Length was then the best decission. BTrees.Length do write
> conflict management.
Yes.
> As I'm not so deep into ZODB I can't say anything about read conflicts.
Read conflicts were added late in ZODB's history after someone noticed
that if you read data from an object that had been invalidated in one
transaction and wrote that data into another object in the course of
another transaction, data inconsistencies could occur. Read conflicts
cannot be resolved unless you're using MVCC, which is only present in
ZODB 3.3 (Zope 2.8 and 3). MVCC's primary job is to prevent read
conflicts.
> My advice is to just replace 'portal_uidgenerator' with your own UID
> or UUID generator implementation.
We should probably fix the default one because it doesn't guarantee
uniqueness of ids. The simplest fix would be to not use a Length object
as the counter but to use a subclass of Length that returned false from
its _p_independent method. This would probably work for most people,
although probably not very well for applications that generated lots of
uids simultaneously.
> By the way: It would be cool if someone could implement <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt> (hint, hint!). Actually I think this should be a python lib ...
I have the beginnings of such a thing at
http://www.plope.com/software/uuidgen/view . Not really, because it
doesn't follow the string formatting rules of the spec and it only does
"Version 4" UUIDs (without a version bit set) but I guess it's a start.
- C
More information about the Zope-CMF
mailing list