From 1ba9c4316ed7e368f8d0c32e71a6f2fde5669d77 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Mon, 31 May 2010 12:48:19 +0000
Subject: [PATCH] Fix for issue #4536. Close JNDI enumerations to avoid unbinding and closing underlying LDAP connection. Fixes in all CLI and control panel.

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
index b898478..e682883 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -4595,8 +4595,15 @@
       {
         NamingEnumeration<SearchResult> res =
           ctx.search(dn, filter, searchControls);
-        SearchResult sr = res.next();
-
+        SearchResult sr = null;
+        try
+        {
+          sr = res.next();
+        }
+        finally
+        {
+          res.close();
+        }
         // Get the number of entries that have been handled and
         // a percentage...
         Message msg;
@@ -4890,7 +4897,15 @@
       {
         NamingEnumeration<SearchResult> res =
           ctx.search(dn, filter, searchControls);
-        SearchResult sr = res.next();
+        SearchResult sr = null;
+        try
+        {
+          sr = res.next();
+        }
+        finally
+        {
+          res.close();
+        }
         String logMsg = getFirstValue(sr, "ds-task-log-message");
         if (logMsg != null)
         {

--
Gitblit v1.10.0