From 7e6c6657bced35f4a3aba723c2add20923450ad6 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Fri, 01 Feb 2008 09:40:56 +0000
Subject: [PATCH] The Replication Server thread that is reading changes from the database to propagate them to the Directory Servers was sometimes leaving some Database cursors open.
---
opends/src/server/org/opends/server/replication/server/ReplicationIterator.java | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java b/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java
index a65f61c..6c078d4 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java
@@ -22,16 +22,16 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2006-2007 Sun Microsystems, Inc.
+ * Portions Copyright 2006-2008 Sun Microsystems, Inc.
*/
package org.opends.server.replication.server;
-import com.sleepycat.je.DatabaseException;
-
import org.opends.server.replication.common.ChangeNumber;
import org.opends.server.replication.protocol.UpdateMessage;
import org.opends.server.replication.server.ReplicationDB.ReplServerDBCursor;
+import com.sleepycat.je.DatabaseException;
+
/**
* This class allows to iterate through the changes received from a given
* LDAP Server Identifier.
@@ -43,6 +43,9 @@
/**
* Creates a new ReplicationIterator.
+ * All created iterator must be released by the caller using the
+ * releaseCursor() method.
+ *
* @param id the Identifier of the server on which the iterator applies.
* @param db The db where the iterator must be created.
* @param changeNumber The ChangeNumber after which the iterator must start.
@@ -56,7 +59,9 @@
{
cursor = db.openReadCursor(changeNumber);
if (cursor == null)
+ {
throw new Exception("no new change");
+ }
if (this.next() == false)
{
cursor.close();
--
Gitblit v1.10.0