[Zope] Duplicated keys in BTreeFolder2

Dieter Maurer dieter at handshake.de
Wed Jan 21 13:38:42 EST 2004


FLORAC Thierry wrote at 2004-1-21 11:57 +0100:
>I currently use a BTreeFolder2 inherited class, called "users", to store my 
>site users profiles.
>My problem is that for a few records (~50 for 5700 users), I have duplicated 
>keys in my folder, pointing to the same record ; if I remove one of these 
>records, the other keys stay into the folder, pointing to nothing !!

I think this should not happen...

The BTrees expert is Tim Peters and he listens on "zodb-dev at zope.org".

Check the validity of the "_tree" attribute in your "BTreeFolder2".
There are several checks in the "BTrees" package.
It is quite easy to corrupt a BTree when you add keys without
persistent order (e.g. because they are mutable).

>My questions now are :
> - how can I avoid these duplicated keys (as long as I only add my users 
>profiles via a simple Python script which shouldn't break keys, with :

Read Tim's messages about "BTrees" and its key requirements
(--> "zodb-dev at zope.org").

-- 
Dieter



More information about the Zope mailing list