Hi, I currently use a custom subclass of BTreeFolder2 to store my site's users profiles (currently 3700). I've noticed several problems : - several keys (= user ids) are duplicated in this folder ; in the ZMI, these duplicated keys appear at the start of the list, unordered. - some keys are duplicated more than once ; if I try to delete one of them, the other duplicated keys are kept and can't be deleted, because the object doesn't exist !!! - if I try to cut a duplicated object and paste it into another folder, I receive an error message, saying that I'm trying to paste an object from a foreign database connection !!! So here are my questions : - is it a bug in BTreeFolder2 ?? Can I avoid this ? - are duplicated keys pointing to the same object or no ? - is it possible to repair this, without losing currently stored objects ?? Thanks for any help... Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
--On Donnerstag, 7. August 2003 10:11 Uhr +0200 Thierry Florac <thierry.florac@onf.fr> wrote:
Hi,
I currently use a custom subclass of BTreeFolder2 to store my site's users profiles (currently 3700).
I've noticed several problems : - several keys (= user ids) are duplicated in this folder ; in the ZMI, these duplicated keys appear at the start of the list, unordered. - some keys are duplicated more than once ; if I try to delete one of them, the other duplicated keys are kept and can't be deleted, because the object doesn't exist !!! - if I try to cut a duplicated object and paste it into another folder, I receive an error message, saying that I'm trying to paste an object from a foreign database connection !!!
So here are my questions : - is it a bug in BTreeFolder2 ?? Can I avoid this ? - are duplicated keys pointing to the same object or no ? - is it possible to repair this, without losing currently stored objects ??
Do you have a unittest to reproduce this? What Zope version are you running? This might be a problem with BTrees. -aj
On Thursday 07 August 2003 10:21, Andreas Jung wrote:
--On Donnerstag, 7. August 2003 10:11 Uhr +0200 Thierry Florac
<thierry.florac@onf.fr> wrote:
Hi,
I currently use a custom subclass of BTreeFolder2 to store my site's users profiles (currently 3700).
I've noticed several problems : - several keys (= user ids) are duplicated in this folder ; in the ZMI, these duplicated keys appear at the start of the list, unordered. - some keys are duplicated more than once ; if I try to delete one of them, the other duplicated keys are kept and can't be deleted, because the object doesn't exist !!! - if I try to cut a duplicated object and paste it into another folder, I receive an error message, saying that I'm trying to paste an object from a foreign database connection !!!
So here are my questions : - is it a bug in BTreeFolder2 ?? Can I avoid this ? - are duplicated keys pointing to the same object or no ? - is it possible to repair this, without losing currently stored objects ??
Do you have a unittest to reproduce this? What Zope version are you running? This might be a problem with BTrees.
I'm afraid no !! I can't get this to be easilly reproductible, but I just noticed that it actually happens sometimes... The only thing I can say to help is to give you the part of my Python script which handles profiles creation ; his goal is just to automatically create a profile for a newly connected user (anonymous access is forbidden, I use ZSession to handle sessions ; "Intraforet" is the name of my product which handle all my custom classes, "users" is the instance of my custom BTreeFolder2 class) : ----- from AccessControl import getSecurityManager acl_user = getSecurityManager().getUser() username = acl_user.getUserName().lower() profile = None if not session.has_key ('IF_USERNAME'): profile = getattr (context.users, username, None) if profile is None: context.users.manage_addProduct['Intraforet'].manage_addIFUser (username, 'if_sql_connexion', 'if_ldap_connexion') profile = getattr (context.users, username) session.set ('IF_USERNAME', username) ----- This seems quite simple to me... Perhaps another solution could be to do : ... profile = IF_User (username, 'if_sql_connexion', 'if_ldap_connexion') context.users._setObject (profile.id, profile) ... but I don't think that this would change anything... No ?? Thierry
Just a guess but do you have a bare 'except:' somewhere in your code that is masking eventual ConflictErrors? Stefan --On Donnerstag, 07. August 2003 10:11 +0200 Thierry Florac <thierry.florac@onf.fr> wrote:
I currently use a custom subclass of BTreeFolder2 to store my site's users profiles (currently 3700).
I've noticed several problems : - several keys (= user ids) are duplicated in this folder ; in the ZMI, these duplicated keys appear at the start of the list, unordered. - some keys are duplicated more than once ; if I try to delete one of them, the other duplicated keys are kept and can't be deleted, because the object doesn't exist !!! - if I try to cut a duplicated object and paste it into another folder, I receive an error message, saying that I'm trying to paste an object from a foreign database connection !!!
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
On Thursday 07 August 2003 21:23, Stefan H. Holek wrote:
Just a guess but do you have a bare 'except:' somewhere in your code that is masking eventual ConflictErrors?
I don't think so... My script is called by "index_html" for every loaded page ; all exceptions are actually handled by "standard_error_message", and I never got any "ConflictError" raised. Thierry P.S.: I'll be out of my office for three weeks since this evening, and so won't be able to provide further informations to you about this problem before September 1.
--On Donnerstag, 07. August 2003 10:11 +0200 Thierry Florac
<thierry.florac@onf.fr> wrote:
I currently use a custom subclass of BTreeFolder2 to store my site's users profiles (currently 3700).
I've noticed several problems : - several keys (= user ids) are duplicated in this folder ; in the ZMI, these duplicated keys appear at the start of the list, unordered. - some keys are duplicated more than once ; if I try to delete one of them, the other duplicated keys are kept and can't be deleted, because the object doesn't exist !!! - if I try to cut a duplicated object and paste it into another folder, I receive an error message, saying that I'm trying to paste an object from a foreign database connection !!!
participants (3)
-
Andreas Jung -
Stefan H. Holek -
Thierry Florac