directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1144329 - /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Date Fri, 08 Jul 2011 14:25:13 GMT
Author: akarasulu
Date: Fri Jul  8 14:25:13 2011
New Revision: 1144329

URL: http://svn.apache.org/viewvc?rev=1144329&view=rev
Log:
DIRSERVER-1633: fixing issue where server fails after second startup

Modified:
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1144329&r1=1144328&r2=1144329&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Fri Jul  8 14:25:13 2011
@@ -774,7 +774,7 @@ public abstract class AbstractStore<E, I
     /**
      * {@inheritDoc}
      * 
-     * Adding an entryinvolve may steps :
+     * Adding an entry involves may steps :
      * - first we must check if the entry exists or not
      * - then we must get a new ID for the added entry
      * - update the RDN index
@@ -794,12 +794,15 @@ public abstract class AbstractStore<E, I
     {
         Dn entryDn = entry.getDn();
 
-        // check if the entry already exists
-        if ( getEntryId( entryDn ) != null )
+        if ( checkHasEntryDuringAdd )
         {
-            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
-                I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, entryDn.getName() ) );
-            throw ne;
+            // check if the entry already exists
+            if ( getEntryId( entryDn ) != null )
+            {
+                LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
+                    I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, entryDn.getName() ) );
+                throw ne;
+            }
         }
 
         ID parentId = null;



Mime
View raw message