Re: too many database conflicts when using ZODB with int ids and indexes
Sanjay Rao <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
How can we say that zc.initid is better than zope.app.intid with respect to
conflict handling ?
zope.app.intid basically creates a hash like this to choose bucket:
def __hash__(self):
return hash((self.object._p_jar.db().database_name,
self.object._p_oid,
))
Where as zc.intid stored int id as an attribute of object itself and keeps
only one mapping from intId -> object.
How zc.intid is avoiding/minimising conflicts
or
let me ask this way: How persistent key -> intid mapping was more conflict
prone than intid->object mapping ?
On Thursday, 10 November 2016 20:33:55 UTC+5:30, Jason Madden wrote:
>
>
> On Nov 10, 2016, at 8:59 AM, Jim Fulton <[email protected] <javascript:>>
> wrote:
>
> At ZC, we mitigated this problem by storing persistent ids on objects and
> getting rid of the whole persistent key mechanism (which was rather
> complicated) and the persistent key -> integer id mapping. I don't
> remember if we ever released this, but looking, it doesn't seem we did.
>
> If your conflicts are in the object -> ids mapping (the internal ``ids``
> attribute, I'd consider making a version of the utility that got rid of
> this mapping.
>
>
> Perhaps consider this utility: https://pypi.python.org/pypi/zc.intid
>
--
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.