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/ads/org/opends/admin/ads/TopologyCache.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java b/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java
index 8d36d01..bbc5685 100644
--- a/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java
+++ b/opendj-sdk/opends/src/ads/org/opends/admin/ads/TopologyCache.java
@@ -475,13 +475,13 @@
LdapName jndiName = new LdapName("cn=monitor");
InitialLdapContext ctx = null;
+ NamingEnumeration<SearchResult> monitorEntries = null;
try
{
ServerLoader loader =
getServerLoader(replicationServer.getAdsProperties());
ctx = loader.createContext();
- NamingEnumeration<SearchResult> monitorEntries =
- ctx.search(jndiName, filter, ctls);
+ monitorEntries = ctx.search(jndiName, filter, ctls);
while(monitorEntries.hasMore())
{
@@ -537,6 +537,10 @@
}
finally
{
+ if (monitorEntries != null)
+ {
+ monitorEntries.close();
+ }
if (ctx != null)
{
ctx.close();
--
Gitblit v1.10.0