[ 
https://issues.apache.org/jira/browse/DIRSTUDIO-913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13660531#comment-13660531
 ] 

Pierre-Arnaud Marcelot commented on DIRSTUDIO-913:
--------------------------------------------------

Ok, I'm starting to understand better what's happening.

Under the hood, Apache Directory Studio has 3 modes for deleting and entry:
- If the server supports the TreeDelete control, it's going to use it and we're 
fine.
- If the server does not support the TreeDelete control:
    - Studio will try to delete the entry as is (because it may not know that 
it has children and we don't want to perform an extra search at first to know 
that). If the the deletion is successful, then we're fine.
    - If the deletion fails and we're getting a particular exception indicating 
that the "context is not empty", then Studio will perform a recursive search 
and delete all underlying entries before deleting the initial entry.

In the case of the "Schema Partition" of ApacheDS, we're not getting that 
particular exception but another kind of the exception and then Studio will not 
try to recursively delete all underlying entries.

Here's the exception:
!STACK 0
java.lang.Exception: [LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for 
MessageType : DEL_REQUEST
Message ID : 38
    Del request
        Entry : 'cn=java,ou=schema'
org.apache.directory.api.ldap.model.message.DeleteRequestImpl@2dae9cc: There 
are children under the entry cn=java,ou=schema]
        at 
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkResponse(DirectoryApiConnectionWrapper.java:1279)
        at 
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.access$600(DirectoryApiConnectionWrapper.java:109)
        at 
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper$7.run(DirectoryApiConnectionWrapper.java:995)
        at 
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.runAndMonitor(DirectoryApiConnectionWrapper.java:1174)
        at 
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkConnectionAndRunAndMonitor(DirectoryApiConnectionWrapper.java:1108)
        at 
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.deleteEntry(DirectoryApiConnectionWrapper.java:1017)
        at 
org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable.deleteEntry(DeleteEntriesRunnable.java:383)
        at 
org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable.optimisticDeleteEntryRecursive(DeleteEntriesRunnable.java:272)
        at 
org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable.run(DeleteEntriesRunnable.java:173)
        at 
org.apache.directory.studio.connection.core.jobs.StudioConnectionJob.run(StudioConnectionJob.java:109)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I think the implementation of the "Schema Partition" of ApacheDS should be 
updated to throw the right exception and give Studio the chance to recursively 
delete all children before the entry.
                
> Removing elements with children under "ou=schema" (ApacheDS) does lead to 
> LDAP errors
> -------------------------------------------------------------------------------------
>
>                 Key: DIRSTUDIO-913
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-913
>             Project: Directory Studio
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M6
>            Reporter: Konrad Windszus
>            Assignee: Pierre-Arnaud Marcelot
>
> Create an embedded server and connect to it. Just click on cn=java,ou=schema 
> and try to remove the element. You get the following error
> {code}
> Error while deleting entry
>  - [LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for MessageType : 
> DEL_REQUES
> java.lang.Exception: [LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for 
> MessageType : DEL_REQUEST
> Message ID : 26
>     Del request
>         Entry : 'cn=java,ou=schema'
> org.apache.directory.api.ldap.model.message.DeleteRequestImpl@a5f31b93: There 
> are children under the entry cn=java,ou=schema]
>       at 
> org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkResponse(DirectoryApiConnectionWrapper.java:1279)
>       at 
> org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.access$600(DirectoryApiConnectionWrapper.java:109)
>       at 
> org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper$7.run(DirectoryApiConnectionWrapper.java:995)
>       at 
> org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.runAndMonitor(DirectoryApiConnectionWrapper.java:1174)
>       at 
> org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkConnectionAndRunAndMonitor(DirectoryApiConnectionWrapper.java:1108)
>       at 
> org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.deleteEntry(DirectoryApiConnectionWrapper.java:1017)
>       at 
> org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable.deleteEntry(DeleteEntriesRunnable.java:382)
>       at 
> org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable.optimisticDeleteEntryRecursive(DeleteEntriesRunnable.java:272)
>       at 
> org.apache.directory.studio.ldapbrowser.core.jobs.DeleteEntriesRunnable.run(DeleteEntriesRunnable.java:173)
>       at 
> org.apache.directory.studio.connection.core.jobs.StudioConnectionJob.run(StudioConnectionJob.java:109)
>       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> [LDAP: error code 53 - UNWILLING_TO_PERFORM: failed for MessageType : 
> DEL_REQUEST
> Message ID : 26
>     Del request
>         Entry : 'cn=java,ou=schema'
> org.apache.directory.api.ldap.model.message.DeleteRequestImpl@a5f31b93: There 
> are children under the entry cn=java,ou=schema]
> {code}
> Directory Studio should try to remove the child elements first.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to