[ZODB-Dev] Unique Object ID
Casey Duncan
casey at ZOPE.COM
Tue Jun 10 13:39:33 EDT 2003
On Tuesday 10 June 2003 08:01 am, Christian Reis wrote:
> On Mon, Jun 09, 2003 at 04:26:36PM -0400, Casey Duncan wrote:
> > _v_nextuid defaults to None using a class attribute. For a single thread,
this
> > will tend to cluster uids sequencially so they don't touch as many
buckets.
> > Since _v_ attrs are thread specific, each thread willbe working from a
> > different base uid.
>
> As Jeremy pointed out, doesn't this raise the chance of getting
> unhandled ConflictErrors in the BTree we store the objects in?
No, because each thread will have a different _v_nextuid. It would be
extremely unlikely for them to collide.
A totally random generation of uids would probably cause more conflicts
because it would tend to touch more btree buckets when multiple entries were
made in a single transaction.
-Casey
More information about the ZODB-Dev
mailing list