From d26d8989bb940946e001956bcc6bcedad5b9c2d9 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 09 Jan 2007 21:11:25 +0000
Subject: [PATCH] Update the add operation code in order to reverse the order in which the locks for the target entry and its parent are released.  This fixes a problem in which deadlocks can occur if a task entry is added and then the client repeatedly retrieves the entry to keep up to date on the status of the task.

---
 opends/src/server/org/opends/server/core/AddOperation.java |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/AddOperation.java b/opends/src/server/org/opends/server/core/AddOperation.java
index 54f9e02..d1958f3 100644
--- a/opends/src/server/org/opends/server/core/AddOperation.java
+++ b/opends/src/server/org/opends/server/core/AddOperation.java
@@ -2049,16 +2049,16 @@
       }
       finally
       {
-        if (parentLock != null)
-        {
-          LockManager.unlock(parentDN, parentLock);
-        }
-
         if (entryLock != null)
         {
           LockManager.unlock(entryDN, entryLock);
         }
 
+        if (parentLock != null)
+        {
+          LockManager.unlock(parentDN, parentLock);
+        }
+
 
         for (SynchronizationProvider provider :
              DirectoryServer.getSynchronizationProviders())

--
Gitblit v1.10.0