directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r230764 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java
Date Mon, 08 Aug 2005 07:09:24 GMT
Author: trustin
Date: Mon Aug  8 00:09:20 2005
New Revision: 230764

URL: http://svn.apache.org/viewcvs?rev=230764&view=rev
Log:
Moved DefaultContextPartitionNexus.destroy() code into removeContextPartition()

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java?rev=230764&r1=230763&r2=230764&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/DefaultContextPartitionNexus.java
Mon Aug  8 00:09:20 2005
@@ -245,18 +245,16 @@
 
         MultiException error = null;
 
-        Iterator list = this.partitions.values().iterator();
+        Iterator suffixes = new HashSet( this.partitions.keySet() ).iterator();
 
         // make sure this loop is not fail fast so all backing stores can
         // have an attempt at closing down and synching their cached entries
-        while ( list.hasNext() )
+        while ( suffixes.hasNext() )
         {
-            ContextPartition partition = ( ContextPartition ) list.next();
-
+            String suffix = (String) suffixes.next();
             try
             {
-                partition.sync();
-                partition.destroy();
+                removeContextPartition( new LdapName( suffix ) );
             }
             catch ( NamingException e )
             {
@@ -379,11 +377,12 @@
             throw new NameNotFoundException( "No partition with suffix: " + key );
         }
         
-        partition.destroy();
-        partitions.remove( key );
-        
         Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
         namingContexts.remove( partition.getSuffix( false ).toString() );
+        partitions.remove( key );
+
+        partition.sync();
+        partition.destroy();
     }
     
     public ContextPartition getSystemPartition()



Mime
View raw message