directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot ...@marcelot.net>
Subject Re: We may need to add a hasChildren() method in the Partition interface
Date Fri, 02 Dec 2011 09:14:35 GMT
+1

Definitely a good utility method to have.

But I feel that the verification that the entry is a leaf and does not have any children,
in the case of a delete operation, should be done by a higher level interceptor (or class).
I'm not sure this scenario should be verified on each partition type but that a higher class
(DirectoryService maybe) should take the responsibility to ask the underlying partition if
the entry is a leaf and then ask it to delete the entry.

Regards,
Pierre-Arnaud

On 2 déc. 2011, at 09:51, Emmanuel Lecharny wrote:

> Hi guys,
> 
> yesterday, we were tracking a bug in the schema manager. When we tried to delete a schema,
we got an error because under the schema entry, we had some entries (cn=attributesTypes, etc).
The entry wasn't deleted, which is good, but the problem was that the schema was removed from
the registries, because it was removed before we tried to do the removal in the underlying
LDIF partition.
> 
> So we added a check to see if the entry has a child, in order to reject the deletion
in all cases (including from the registries). Sadly, we had to code a search (ONE_LEVEL) to
now if we had some children. This could have been done using a lookup in the one_level index,
but it's not exposed by the Partition interface.
> 
> Adding a hasChildren(Dn) method would help, as we could get the result either by using
the one_level index if it exists, or by doing something else.
> 
> wdyt ?
> 
> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
> 


Mime
View raw message