directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1387297 - /directory/apacheds/branches/apacheds-mvbt/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
Date Tue, 18 Sep 2012 18:15:04 GMT
Author: elecharny
Date: Tue Sep 18 18:15:03 2012
New Revision: 1387297

URL: http://svn.apache.org/viewvc?rev=1387297&view=rev
Log:
Protect the lookup from concurrent modifications

Modified:
    directory/apacheds/branches/apacheds-mvbt/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java

Modified: directory/apacheds/branches/apacheds-mvbt/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=1387297&r1=1387296&r2=1387297&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
Tue Sep 18 18:15:03 2012
@@ -559,15 +559,15 @@ public class DefaultOperationManager imp
         directoryService.getReferralManager().unlock();
 
         // populate the context with the old entry
-        eagerlyPopulateFields( deleteContext );
-
-        // Call the Delete method
-        Interceptor head = directoryService.getInterceptor( deleteContext.getNextInterceptor()
);
-
         try
         {
             lockWrite();
 
+            eagerlyPopulateFields( deleteContext );
+
+            // Call the Delete method
+            Interceptor head = directoryService.getInterceptor( deleteContext.getNextInterceptor()
);
+
             head.delete( deleteContext );
         }
         finally
@@ -763,16 +763,16 @@ public class DefaultOperationManager imp
         // Unlock the ReferralManager
         referralManager.unlock();
 
-        // populate the context with the old entry
-        eagerlyPopulateFields( modifyContext );
-
-        // Call the Modify method
-        Interceptor head = directoryService.getInterceptor( modifyContext.getNextInterceptor()
);
-
         try
         {
             lockWrite();
 
+            // populate the context with the old entry
+            eagerlyPopulateFields( modifyContext );
+
+            // Call the Modify method
+            Interceptor head = directoryService.getInterceptor( modifyContext.getNextInterceptor()
);
+
             head.modify( modifyContext );
         }
         finally
@@ -870,17 +870,17 @@ public class DefaultOperationManager imp
         // Unlock the ReferralManager
         directoryService.getReferralManager().unlock();
 
-        Entry originalEntry = getOriginalEntry( moveContext );
-
-        moveContext.setOriginalEntry( originalEntry );
-
-        // Call the Move method
-        Interceptor head = directoryService.getInterceptor( moveContext.getNextInterceptor()
);
-
         try
         {
             lockWrite();
 
+            Entry originalEntry = getOriginalEntry( moveContext );
+
+            moveContext.setOriginalEntry( originalEntry );
+
+            // Call the Move method
+            Interceptor head = directoryService.getInterceptor( moveContext.getNextInterceptor()
);
+
             head.move( moveContext );
         }
         finally
@@ -980,16 +980,16 @@ public class DefaultOperationManager imp
         // Unlock the ReferralManager
         directoryService.getReferralManager().unlock();
 
-        moveAndRenameContext.setOriginalEntry( getOriginalEntry( moveAndRenameContext ) );
-        moveAndRenameContext.setModifiedEntry( moveAndRenameContext.getOriginalEntry().clone()
);
-
-        // Call the MoveAndRename method
-        Interceptor head = directoryService.getInterceptor( moveAndRenameContext.getNextInterceptor()
);
-
         try
         {
             lockWrite();
 
+            moveAndRenameContext.setOriginalEntry( getOriginalEntry( moveAndRenameContext
) );
+            moveAndRenameContext.setModifiedEntry( moveAndRenameContext.getOriginalEntry().clone()
);
+
+            // Call the MoveAndRename method
+            Interceptor head = directoryService.getInterceptor( moveAndRenameContext.getNextInterceptor()
);
+
             head.moveAndRename( moveAndRenameContext );
         }
         finally
@@ -1079,18 +1079,19 @@ public class DefaultOperationManager imp
 
         // Call the rename method
         // populate the context with the old entry
-        eagerlyPopulateFields( renameContext );
-        Entry originalEntry = getOriginalEntry( renameContext );
-        renameContext.setOriginalEntry( originalEntry );
-        renameContext.setModifiedEntry( originalEntry.clone() );
-
-        // Call the Rename method
-        Interceptor head = directoryService.getInterceptor( renameContext.getNextInterceptor()
);
 
         try
         {
             lockWrite();
 
+            eagerlyPopulateFields( renameContext );
+            Entry originalEntry = getOriginalEntry( renameContext );
+            renameContext.setOriginalEntry( originalEntry );
+            renameContext.setModifiedEntry( originalEntry.clone() );
+
+            // Call the Rename method
+            Interceptor head = directoryService.getInterceptor( renameContext.getNextInterceptor()
);
+
             head.rename( renameContext );
         }
         finally



Mime
View raw message