directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1324565 [1/2] - in /directory/apacheds/branches/index-work: core-api/src/main/java/org/apache/directory/server/core/api/ core-api/src/main/java/org/apache/directory/server/core/api/filtering/ core-avl/src/main/java/org/apache/directory/ser...
Date Wed, 11 Apr 2012 05:30:47 GMT
Author: elecharny
Date: Wed Apr 11 05:30:46 2012
New Revision: 1324565

URL: http://svn.apache.org/viewvc?rev=1324565&view=rev
Log:
o Added a dedicated logger for all the cursor open/close operations
o Traced all the openings and closings of cursors

Modified:
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
    directory/apacheds/branches/index-work/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java
    directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
    directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java
    directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java
    directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
    directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
    directory/apacheds/branches/index-work/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ChildrenCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java (original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java Wed Apr 11 05:30:46 2012
@@ -66,7 +66,7 @@ public class EntryToResponseCursor imple
 
     public EntryToResponseCursor( int messageId, Cursor<Entry> wrapped )
     {
-        LOG_CURSOR.debug( "Creating EntryToResponseCursor " + this );
+        LOG_CURSOR.debug( "Creating EntryToResponseCursor {}", this );
         this.wrapped = wrapped;
         this.messageId = messageId;
     }
@@ -110,14 +110,14 @@ public class EntryToResponseCursor imple
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryToResponseCursor " + this );
+        LOG_CURSOR.debug( "Closing EntryToResponseCursor {}", this );
         wrapped.close();
     }
 
 
     public void close( Exception e ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryToResponseCursor " + this );
+        LOG_CURSOR.debug( "Closing EntryToResponseCursor {}", this );
         wrapped.close( e );
     }
 

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java (original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java Wed Apr 11 05:30:46 2012
@@ -104,7 +104,7 @@ public class BaseEntryFilteringCursor im
      */
     public BaseEntryFilteringCursor( Cursor<Entry> wrapped, SearchingOperationContext operationContext )
     {
-        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor " + this );
+        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor {}", this );
         this.wrapped = wrapped;
         this.operationContext = operationContext;
         this.filters = new ArrayList<EntryFilter>();
@@ -123,7 +123,7 @@ public class BaseEntryFilteringCursor im
     public BaseEntryFilteringCursor( Cursor<Entry> wrapped,
         SearchingOperationContext operationContext, List<EntryFilter> filters )
     {
-        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor " + this );
+        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor {}", this );
         this.wrapped = wrapped;
         this.operationContext = operationContext;
         this.filters = new ArrayList<EntryFilter>();
@@ -253,7 +253,7 @@ public class BaseEntryFilteringCursor im
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor " + this );
+        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor {}", this );
         wrapped.close();
         prefetched = null;
     }
@@ -264,7 +264,7 @@ public class BaseEntryFilteringCursor im
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor " + this );
+        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor {}", this );
         wrapped.close( reason );
         prefetched = null;
     }

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java (original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java Wed Apr 11 05:30:46 2012
@@ -84,7 +84,7 @@ public class CursorList implements Entry
      */
     public CursorList( int start, List<EntryFilteringCursor> list, int end, SearchingOperationContext searchContext )
     {
-        LOG_CURSOR.debug( "Creating CursorList " + this );
+        LOG_CURSOR.debug( "Creating CursorList {}", this );
         
         if ( list != null )
         {
@@ -447,14 +447,14 @@ public class CursorList implements Entry
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing CursorList " + this );
+        LOG_CURSOR.debug( "Closing CursorList {}", this );
         close( null );
     }
 
 
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing CursorList " + this );
+        LOG_CURSOR.debug( "Closing CursorList {}", this );
         closed = true;
 
         for ( Cursor<?> c : list )

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java (original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java Wed Apr 11 05:30:46 2012
@@ -52,7 +52,7 @@ public class ArrayTreeCursor<E> extends 
      */
     public ArrayTreeCursor( ArrayTree<E> array )
     {
-        LOG_CURSOR.debug( "Creating ArrayTreeCursor " + this );
+        LOG_CURSOR.debug( "Creating ArrayTreeCursor {}", this );
         this.array = array;
         position = Position.BEFORE_FIRST;
     }
@@ -305,7 +305,7 @@ public class ArrayTreeCursor<E> extends 
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing ArrayTreeCursor " + this );
+        LOG_CURSOR.debug( "Closing ArrayTreeCursor {}", this );
         super.close();
     }
 
@@ -315,7 +315,7 @@ public class ArrayTreeCursor<E> extends 
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing ArrayTreeCursor " + this );
+        LOG_CURSOR.debug( "Closing ArrayTreeCursor {}", this );
         super.close( reason );
     }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java (original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java Wed Apr 11 05:30:46 2012
@@ -53,7 +53,7 @@ public class AvlSingletonOrOrderedSetCur
 
     public AvlSingletonOrOrderedSetCursor( AvlTreeMap<K, V> tree )
     {
-        LOG_CURSOR.debug( "Creating AvlSingletonOrOrderedSetCursor " + this );
+        LOG_CURSOR.debug( "Creating AvlSingletonOrOrderedSetCursor {}", this );
         this.tree = tree;
     }
 
@@ -298,7 +298,7 @@ public class AvlSingletonOrOrderedSetCur
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor " + this );
+        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor {}", this );
         super.close();
     }
 
@@ -308,7 +308,7 @@ public class AvlSingletonOrOrderedSetCur
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor " + this );
+        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor {}", this );
         super.close( reason );
     }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java (original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java Wed Apr 11 05:30:46 2012
@@ -48,7 +48,7 @@ public class AvlTreeCursor<E> extends Ab
 
     public AvlTreeCursor( AvlTree<E> tree )
     {
-        LOG_CURSOR.debug( "Creating AvlTreeCursor " + this );
+        LOG_CURSOR.debug( "Creating AvlTreeCursor {}", this );
         this.tree = tree;
     }
 
@@ -255,7 +255,7 @@ public class AvlTreeCursor<E> extends Ab
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeCursor " + this );
+        LOG_CURSOR.debug( "Closing AvlTreeCursor {}", this );
         super.close();
     }
 
@@ -265,7 +265,7 @@ public class AvlTreeCursor<E> extends Ab
      */
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeCursor " + this );
+        LOG_CURSOR.debug( "Closing AvlTreeCursor {}", this );
         super.close( reason );
     }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java (original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java Wed Apr 11 05:30:46 2012
@@ -44,7 +44,7 @@ public class AvlTreeMapNoDupsWrapperCurs
 
     public AvlTreeMapNoDupsWrapperCursor( AvlSingletonOrOrderedSetCursor<K, V> wrapped )
     {
-        LOG_CURSOR.debug( "Creating AvlTreeMapNoDupsWrapperCursor " + this );
+        LOG_CURSOR.debug( "Creating AvlTreeMapNoDupsWrapperCursor {}", this );
         this.wrapped = wrapped;
     }
 
@@ -148,14 +148,14 @@ public class AvlTreeMapNoDupsWrapperCurs
 
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor " + this );
+        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor {}", this );
         wrapped.close();
     }
 
 
     public void close( Exception reason ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor " + this );
+        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor {}", this );
         wrapped.close( reason );
     }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java (original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java Wed Apr 11 05:30:46 2012
@@ -54,7 +54,7 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public KeyTupleAvlCursor( AvlTree<V> avlTree, K key )
     {
-        LOG_CURSOR.debug( "Creating KeyTupleAvlCursor " + this );
+        LOG_CURSOR.debug( "Creating KeyTupleAvlCursor {}", this );
         this.key = key;
         this.wrapped = new AvlTreeCursor<V>( avlTree );
     }
@@ -217,7 +217,7 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor " + this );
+        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor {}", this );
         super.close();
 
         if ( wrapped != null )
@@ -232,7 +232,7 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor " + this );
+        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor {}", this );
         super.close( cause );
 
         if ( wrapped != null )

Modified: directory/apacheds/branches/index-work/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/index-work/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Wed Apr 11 05:30:46 2012
@@ -386,6 +386,7 @@ public class SubentryInterceptor extends
                     nexus.modify( new ModifyOperationContext( session, candidateDn, modifications ) );
                 }
             }
+            
             subentries.close();
         }
         catch ( Exception e )

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursor.java Wed Apr 11 05:30:46 2012
@@ -29,6 +29,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -41,6 +43,9 @@ import org.apache.directory.shared.ldap.
  */
 public class DupsContainerCursor<K, V> extends AbstractCursor<Tuple<K, DupsContainer<V>>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The JDBM table we are building a cursor over */
     private final JdbmTable<K, V> table;
 
@@ -68,6 +73,8 @@ public class DupsContainerCursor<K, V> e
      */
     public DupsContainerCursor( JdbmTable<K, V> table ) throws IOException
     {
+        LOG_CURSOR.debug( "Creating DupsContainerCursor {}", this );
+        
         if ( !table.isDupsEnabled() )
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_572 ) );
@@ -376,8 +383,9 @@ public class DupsContainerCursor<K, V> e
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing DupsContainerCursor {}", this );
         super.close();
-        this.closeBrowser( browser );
+        closeBrowser( browser );
     }
 
 
@@ -387,8 +395,9 @@ public class DupsContainerCursor<K, V> e
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing DupsContainerCursor {}", this );
         super.close( cause );
-        this.closeBrowser( browser );
+        closeBrowser( browser );
     }
 
 

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java Wed Apr 11 05:30:46 2012
@@ -41,6 +41,9 @@ class DupsCursor<K, V> extends AbstractC
 {
     private static final Logger LOG = LoggerFactory.getLogger( DupsCursor.class.getSimpleName() );
 
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /**
      * The JDBM backed table this Cursor traverses over.
      */
@@ -83,6 +86,7 @@ class DupsCursor<K, V> extends AbstractC
 
     public DupsCursor( JdbmTable<K, V> table ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating DupsCursor {}", this );
         this.table = table;
         this.containerCursor = new DupsContainerCursor<K, V>( table );
         LOG.debug( "Created on table {}", table );
@@ -281,6 +285,7 @@ class DupsCursor<K, V> extends AbstractC
             valueAvailable = true;
             returnedTuple.setKey( containerTuple.getKey() );
             returnedTuple.setValue( dupsCursor.get() );
+            
             return true;
         }
 
@@ -319,6 +324,7 @@ class DupsCursor<K, V> extends AbstractC
             valueAvailable = true;
             returnedTuple.setKey( containerTuple.getKey() );
             returnedTuple.setValue( dupsCursor.get() );
+            
             return true;
         }
 
@@ -343,6 +349,11 @@ class DupsCursor<K, V> extends AbstractC
          */
         if ( null == dupsCursor || !dupsCursor.previous() )
         {
+            if ( dupsCursor != null )
+            {
+                dupsCursor.close();
+            }
+
             /*
              * If the wrappedCursor cursor has more elements we get the previous
              * key/AvlTree Tuple to work with and get a cursor over it's
@@ -382,6 +393,7 @@ class DupsCursor<K, V> extends AbstractC
 
         returnedTuple.setKey( containerTuple.getKey() );
         returnedTuple.setValue( dupsCursor.get() );
+        
         return valueAvailable = true;
     }
 
@@ -393,8 +405,13 @@ class DupsCursor<K, V> extends AbstractC
          * If the iterator over the values of the current key is null or is
          * extinguished then we need to advance to the next key.
          */
-        if ( null == dupsCursor || !dupsCursor.next() )
+        if ( ( null == dupsCursor ) || !dupsCursor.next() )
         {
+            if ( dupsCursor != null )
+            {
+                dupsCursor.close();
+            }
+            
             /*
              * If the wrappedCursor cursor has more elements we get the next
              * key/AvlTree Tuple to work with and get a cursor over it.
@@ -440,6 +457,7 @@ class DupsCursor<K, V> extends AbstractC
          */
         returnedTuple.setKey( containerTuple.getKey() );
         returnedTuple.setValue( dupsCursor.get() );
+        
         return valueAvailable = true;
     }
 
@@ -463,8 +481,14 @@ class DupsCursor<K, V> extends AbstractC
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing DupsCursor {}", this );
         super.close();
         containerCursor.close();
+        
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
     }
 
 
@@ -474,7 +498,13 @@ class DupsCursor<K, V> extends AbstractC
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing DupsCursor {}", this );
         super.close( cause );
         containerCursor.close( cause );
+        
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close( cause );
+        }
     }
 }

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyBTreeCursor.java Wed Apr 11 05:30:46 2012
@@ -27,6 +27,8 @@ import jdbm.helper.TupleBrowser;
 
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -37,6 +39,9 @@ import org.apache.directory.shared.ldap.
  */
 public class KeyBTreeCursor<E> extends AbstractCursor<E>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final Tuple tuple = new Tuple();
 
     private final BTree btree;
@@ -54,6 +59,7 @@ public class KeyBTreeCursor<E> extends A
      */
     public KeyBTreeCursor( BTree btree, Comparator<E> comparator ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating KeyBTreeCursor {}", this );
         this.btree = btree;
         this.comparator = comparator;
     }
@@ -218,6 +224,7 @@ public class KeyBTreeCursor<E> extends A
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing KeyBTreeCursor {}", this );
         super.close();
         this.closeBrowser( browser );
     }
@@ -229,6 +236,7 @@ public class KeyBTreeCursor<E> extends A
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing KeyBTreeCursor {}", this );
         super.close( cause );
         this.closeBrowser( browser );
     }

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java Wed Apr 11 05:30:46 2012
@@ -25,6 +25,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,6 +38,9 @@ import org.apache.directory.shared.ldap.
  */
 public class KeyTupleArrayCursor<K, V> extends AbstractCursor<Tuple<K, V>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final ArrayTreeCursor<V> wrapped;
     private final K key;
 
@@ -51,6 +56,7 @@ public class KeyTupleArrayCursor<K, V> e
      */
     public KeyTupleArrayCursor( ArrayTree<V> arrayTree, K key )
     {
+        LOG_CURSOR.debug( "Creating KeyTupleArrayCursor {}", this );
         this.key = key;
         this.wrapped = new ArrayTreeCursor<V>( arrayTree );
     }
@@ -206,4 +212,36 @@ public class KeyTupleArrayCursor<K, V> e
 
         throw new InvalidCursorPositionException();
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing KeyTupleArrayCursor {}", this );
+        
+        if ( wrapped != null )
+        {
+            wrapped.close();
+        }
+        
+        super.close();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception reason ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing KeyTupleArrayCursor {}", this );
+        
+        if ( wrapped != null )
+        {
+            wrapped.close( reason );
+        }
+        
+        super.close( reason );
+    }
 }

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java Wed Apr 11 05:30:46 2012
@@ -28,6 +28,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -39,6 +41,9 @@ import org.apache.directory.shared.ldap.
  */
 public class KeyTupleBTreeCursor<K, V> extends AbstractCursor<Tuple<K, V>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final Comparator<V> comparator;
     private final BTree btree;
     private final K key;
@@ -59,6 +64,7 @@ public class KeyTupleBTreeCursor<K, V> e
      */
     public KeyTupleBTreeCursor( BTree btree, K key, Comparator<V> comparator ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating KeyTupleBTreeCursor {}", this );
         this.key = key;
         this.btree = btree;
         this.comparator = comparator;
@@ -321,8 +327,9 @@ public class KeyTupleBTreeCursor<K, V> e
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing KeyTupleBTreeCursor {}", this );
         super.close();
-        this.closeBrowser( browser );
+        closeBrowser( browser );
     }
 
 
@@ -332,8 +339,9 @@ public class KeyTupleBTreeCursor<K, V> e
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing KeyTupleBTreeCursor {}", this );
         super.close( cause );
-        this.closeBrowser( browser );
+        closeBrowser( browser );
     }
 
 

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursor.java Wed Apr 11 05:30:46 2012
@@ -27,6 +27,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -39,6 +41,9 @@ import org.apache.directory.shared.ldap.
  */
 class NoDupsCursor<K, V> extends AbstractCursor<Tuple<K, V>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final JdbmTable<K, V> table;
 
     private jdbm.helper.Tuple jdbmTuple = new jdbm.helper.Tuple();
@@ -55,6 +60,7 @@ class NoDupsCursor<K, V> extends Abstrac
      */
     public NoDupsCursor( JdbmTable<K, V> table ) throws IOException
     {
+        LOG_CURSOR.debug( "Creating NoDupsCursor {}", this );
         this.table = table;
     }
 
@@ -254,8 +260,9 @@ class NoDupsCursor<K, V> extends Abstrac
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing NoDupsCursor {}", this );
         super.close();
-        this.closeBrowser( browser );
+        closeBrowser( browser );
     }
 
 
@@ -265,8 +272,9 @@ class NoDupsCursor<K, V> extends Abstrac
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing NoDupsCursor {}", this );
         super.close( cause );
-        this.closeBrowser( browser );
+        closeBrowser( browser );
     }
 
 

Modified: directory/apacheds/branches/index-work/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java (original)
+++ directory/apacheds/branches/index-work/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaJournalCursor.java Wed Apr 11 05:30:46 2012
@@ -43,6 +43,9 @@ public class ReplicaJournalCursor extend
     /** Logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( ReplicaJournalCursor.class );
 
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** the underlying journal's cursor */
     private Cursor<Tuple<String, ReplicaEventMessage>> tupleCursor;
 
@@ -63,6 +66,7 @@ public class ReplicaJournalCursor extend
      */
     public ReplicaJournalCursor( JdbmTable<String, ReplicaEventMessage> journal, String consumerCsn ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating ReplicaJournalCursor {}", this );
         this.journal = journal;
         this.tupleCursor = journal.cursor();
         this.consumerCsn = consumerCsn;
@@ -212,6 +216,7 @@ public class ReplicaJournalCursor extend
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing ReplicaJournalCursor {}", this );
         tupleCursor.close();
         super.close();
     }
@@ -223,6 +228,7 @@ public class ReplicaJournalCursor extend
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing ReplicaJournalCursor {}", this );
         tupleCursor.close();
         super.close( cause );
     }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java Wed Apr 11 05:30:46 2012
@@ -29,6 +29,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.CursorIterator;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,12 +40,16 @@ import org.apache.directory.shared.ldap.
  */
 public class EntryCursorAdaptor<ID extends Comparable<ID>> implements Cursor<Entry>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final AbstractBTreePartition<ID> db;
     private final IndexCursor<ID, Entry, ID> indexCursor;
 
 
     public EntryCursorAdaptor( AbstractBTreePartition<ID> db, IndexCursor<ID, Entry, ID> indexCursor )
     {
+        LOG_CURSOR.debug( "Creating EntryCursorAdaptor {}", this );
         this.db = db;
         this.indexCursor = indexCursor;
     }
@@ -100,21 +106,23 @@ public class EntryCursorAdaptor<ID exten
     }
 
 
-    /* 
-     * @see Cursor#close()
+    /**
+     * {@inheritDoc}}
      */
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing EntryCursorAdaptor {}", this );
         indexCursor.close();
     }
 
 
-    /* 
-     * @see Cursor#close()
+    /**
+     * {@inheritDoc}
      */
-    public void close( Exception e ) throws Exception
+    public void close( Exception cause ) throws Exception
     {
-        indexCursor.close( e );
+        LOG_CURSOR.debug( "Closing EntryCursorAdaptor {}", this );
+        indexCursor.close( cause );
     }
 
 

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java Wed Apr 11 05:30:46 2012
@@ -24,7 +24,6 @@ import java.util.Iterator;
 
 import org.apache.directory.server.xdbm.AbstractIndexCursor;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.ReverseIndexEntry;
 import org.apache.directory.shared.i18n.I18n;
@@ -32,6 +31,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.CursorIterator;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -42,6 +43,9 @@ import org.apache.directory.shared.ldap.
  */
 public class IndexCursorAdaptor<K, O, ID> extends AbstractIndexCursor<K, O, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     @SuppressWarnings("unchecked")
     final Cursor<Tuple> wrappedCursor;
     final ForwardIndexEntry<K, ID> forwardEntry;
@@ -59,6 +63,7 @@ public class IndexCursorAdaptor<K, O, ID
     @SuppressWarnings("unchecked")
     public IndexCursorAdaptor( Cursor<Tuple> wrappedCursor, boolean forwardIndex )
     {
+        LOG_CURSOR.debug( "Creating IndexCursorAdaptor {}", this );
         this.wrappedCursor = wrappedCursor;
 
         if ( forwardIndex )
@@ -160,12 +165,14 @@ public class IndexCursorAdaptor<K, O, ID
 
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing IndexCursorAdaptor {}", this );
         wrappedCursor.close();
     }
 
 
     public void close( Exception reason ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing IndexCursorAdaptor {}", this );
         wrappedCursor.close( reason );
     }
 

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java Wed Apr 11 05:30:46 2012
@@ -27,6 +27,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.util.exception.NotImplementedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,6 +38,9 @@ import org.apache.directory.shared.util.
  */
 public class ValueArrayCursor<K, V> extends AbstractCursor<Tuple<K, V>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private static final int BEFORE_FIRST = -1;
 
     private final K key;
@@ -47,6 +52,7 @@ public class ValueArrayCursor<K, V> exte
 
     public ValueArrayCursor( final K key, final V[] values )
     {
+        LOG_CURSOR.debug( "Creating ValueArrayCursor {}", this );
         this.key = key;
         this.tuple.setKey( key );
         this.values = Arrays.asList( values );
@@ -55,6 +61,7 @@ public class ValueArrayCursor<K, V> exte
 
     public ValueArrayCursor( final K key, final List<V> values )
     {
+        LOG_CURSOR.debug( "Creating ValueArrayCursor {}", this );
         this.key = key;
         this.tuple.setKey( key );
         this.values = values;
@@ -199,4 +206,26 @@ public class ValueArrayCursor<K, V> exte
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_701, pos, ( values.size() - 1 ) ) );
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing ValueArrayCursor {}", this );
+        super.close();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing ValueArrayCursor {}", this );
+        super.close( cause );
+    }
 }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java Wed Apr 11 05:30:46 2012
@@ -21,6 +21,8 @@ package org.apache.directory.server.xdbm
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -30,6 +32,15 @@ import org.apache.directory.shared.ldap.
  */
 public class EmptyIndexCursor<K, E, ID> extends AbstractIndexCursor<K, E, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
+    public EmptyIndexCursor()
+    {
+        LOG_CURSOR.debug( "Creating EmptyIndexCursor {}", this );
+    }
+    
+    
     /**
      * {@inheritDoc}
      */
@@ -120,4 +131,24 @@ public class EmptyIndexCursor<K, E, ID> 
     {
         checkNotClosed( "after()" );
     }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void close( ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this );
+        super.close();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this );
+        super.close( cause );
+    }
 }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java Wed Apr 11 05:30:46 2012
@@ -22,6 +22,8 @@ package org.apache.directory.server.xdbm
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -31,6 +33,9 @@ import org.apache.directory.shared.ldap.
  */
 public class SingletonIndexCursor<V, ID> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private boolean beforeFirst = true;
     private boolean afterLast;
     private boolean onSingleton;
@@ -39,6 +44,7 @@ public class SingletonIndexCursor<V, ID>
 
     public SingletonIndexCursor( IndexEntry<V, ID> singleton )
     {
+        LOG_CURSOR.debug( "Creating SingletonIndexCursor {}", this );
         this.singleton = singleton;
     }
 
@@ -190,4 +196,18 @@ public class SingletonIndexCursor<V, ID>
             throw new InvalidCursorPositionException( I18n.err( I18n.ERR_706 ) );
         }
     }
+
+
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this );
+        super.close();
+    }
+
+
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this );
+        super.close( cause );
+    }
 }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTableDupsCursor.java Wed Apr 11 05:30:46 2012
@@ -44,6 +44,9 @@ public class AvlTableDupsCursor<K, V> ex
 {
     private static final Logger LOG = LoggerFactory.getLogger( AvlTableDupsCursor.class.getSimpleName() );
 
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The AVL backed table this Cursor traverses over. */
     private final AvlTable<K, V> table;
 
@@ -83,6 +86,7 @@ public class AvlTableDupsCursor<K, V> ex
      */
     public AvlTableDupsCursor( AvlTable<K, V> table )
     {
+        LOG_CURSOR.debug( "Creating AvlTableDupsCursor {}", this );
         this.table = table;
         this.wrappedCursor = new AvlSingletonOrOrderedSetCursor<K, V>( table.getAvlTreeMap() );
         LOG.debug( "Created on table {}", table.getName() );
@@ -114,6 +118,11 @@ public class AvlTableDupsCursor<K, V> ex
     {
         checkNotClosed( "beforeValue()" );
         wrappedCursor.beforeKey( key );
+        
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
 
         if ( wrappedCursor.next() )
         {
@@ -172,6 +181,12 @@ public class AvlTableDupsCursor<K, V> ex
     public void afterValue( K key, V value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
+
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+
         /*
          * There is a subtle difference between after and before handling
          * with dupicate key values.  Say we have the following tuples:
@@ -220,6 +235,7 @@ public class AvlTableDupsCursor<K, V> ex
             if ( value == null )
             {
                 clearValue();
+                
                 return;
             }
 
@@ -258,6 +274,12 @@ public class AvlTableDupsCursor<K, V> ex
         wrappedCursor.afterLast();
         wrappedTuple.setKey( null );
         wrappedTuple.setValue( null );
+
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+
         dupsCursor = null;
     }
 
@@ -281,6 +303,12 @@ public class AvlTableDupsCursor<K, V> ex
         wrappedCursor.beforeFirst();
         wrappedTuple.setKey( null );
         wrappedTuple.setValue( null );
+
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+
         dupsCursor = null;
     }
 
@@ -292,6 +320,12 @@ public class AvlTableDupsCursor<K, V> ex
     {
         checkNotClosed( "first()" );
         clearValue();
+
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+
         dupsCursor = null;
 
         if ( wrappedCursor.first() )
@@ -317,6 +351,7 @@ public class AvlTableDupsCursor<K, V> ex
             valueAvailable = true;
             returnedTuple.setKey( wrappedTuple.getKey() );
             returnedTuple.setValue( dupsCursor.get() );
+            
             return true;
         }
 
@@ -347,8 +382,12 @@ public class AvlTableDupsCursor<K, V> ex
     {
         checkNotClosed( "last()" );
         clearValue();
-        dupsCursor = null;
-
+        
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+        
         if ( wrappedCursor.last() )
         {
             wrappedTuple.setBoth( wrappedCursor.get() );
@@ -372,6 +411,7 @@ public class AvlTableDupsCursor<K, V> ex
             valueAvailable = true;
             returnedTuple.setKey( wrappedTuple.getKey() );
             returnedTuple.setValue( dupsCursor.get() );
+            
             return true;
         }
 
@@ -385,12 +425,18 @@ public class AvlTableDupsCursor<K, V> ex
     public boolean next() throws Exception
     {
         checkNotClosed( "next()" );
+        
         /*
          * If the cursor over the values of the current key is null or is
          * extinguished then we need to advance to the next key.
          */
         if ( null == dupsCursor || !dupsCursor.next() )
         {
+            if ( dupsCursor != null )
+            {
+                dupsCursor.close();
+            }
+            
             /*
              * If the wrappedCursor cursor has more elements we get the next
              * key/AvlTree Tuple to work with and get a cursor over it.
@@ -421,6 +467,7 @@ public class AvlTableDupsCursor<K, V> ex
             else
             {
                 dupsCursor = null;
+                
                 return false;
             }
         }
@@ -434,6 +481,7 @@ public class AvlTableDupsCursor<K, V> ex
          */
         returnedTuple.setKey( wrappedTuple.getKey() );
         returnedTuple.setValue( dupsCursor.get() );
+        
         return valueAvailable = true;
     }
 
@@ -448,8 +496,13 @@ public class AvlTableDupsCursor<K, V> ex
          * If the cursor over the values of the current key is null or is
          * extinguished then we need to advance to the previous key.
          */
-        if ( null == dupsCursor || !dupsCursor.previous() )
+        if ( ( null == dupsCursor ) || !dupsCursor.previous() )
         {
+            if ( dupsCursor != null )
+            {
+                dupsCursor.close();
+            }
+            
             /*
              * If the wrappedCursor cursor has more elements we get the previous
              * key/AvlTree Tuple to work with and get a cursor over it's
@@ -481,15 +534,44 @@ public class AvlTableDupsCursor<K, V> ex
             else
             {
                 dupsCursor = null;
+                
                 return false;
             }
         }
 
         returnedTuple.setKey( wrappedTuple.getKey() );
         returnedTuple.setValue( dupsCursor.get() );
+        
         return valueAvailable = true;
     }
 
+    
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlTableDupsCursor {}", this );
+        
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+        
+        wrappedCursor.close();
+    }
+
+
+    public void close( Exception reason ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlTableDupsCursor {}", this );
+
+        if ( dupsCursor != null )
+        {
+            dupsCursor.close();
+        }
+
+        wrappedCursor.close();
+    }
+
+
 
     /**
      * Clears the returned Tuple and makes sure valueAvailable returns false.

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java Wed Apr 11 05:30:46 2012
@@ -26,6 +26,8 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -35,6 +37,9 @@ import org.apache.directory.shared.ldap.
  */
 public class AllEntriesCursor<ID extends Comparable<ID>> extends AbstractIndexCursor<ID, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The index entry we use to return entries one by one.  */
     private IndexEntry<ID, ID> indexEntry = new ForwardIndexEntry<ID, ID>();
 
@@ -58,6 +63,7 @@ public class AllEntriesCursor<ID extends
      */
     public AllEntriesCursor( Store<Entry, ID> db ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating AllEntriesCursor {}", this );
         // Get a reverse cursor because we want to sort by ID
         wrapped = db.getEntryUuidIndex().reverseCursor();
     }
@@ -205,6 +211,7 @@ public class AllEntriesCursor<ID extends
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing AllEntriesCursor {}", this );
         wrapped.close();
     }
 
@@ -215,6 +222,7 @@ public class AllEntriesCursor<ID extends
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing AllEntriesCursor {}", this );
         wrapped.close( cause );
     }
 }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java Wed Apr 11 05:30:46 2012
@@ -32,6 +32,8 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -41,6 +43,9 @@ import org.apache.directory.shared.ldap.
  */
 public class AndCursor<V, ID> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
 
@@ -61,6 +66,7 @@ public class AndCursor<V, ID> extends Ab
     public AndCursor( IndexCursor<V, Entry, ID> wrapped,
         List<Evaluator<? extends ExprNode, Entry, ID>> evaluators )
     {
+        LOG_CURSOR.debug( "Creating AndCursor {}", this );
         this.wrapped = wrapped;
         this.evaluators = optimize( evaluators );
     }
@@ -175,18 +181,30 @@ public class AndCursor<V, ID> extends Ab
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );
     }
 
-
+    
     /**
      * {@inheritDoc}
      */
-    public void close() throws Exception
+    public void close( ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing AndCursor {}", this );
         super.close();
         wrapped.close();
     }
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AndCursor {}", this );
+        super.close( cause );
+        wrapped.close( cause );
+    }
+
+
+    /**
      * Takes a set of Evaluators and copies then sorts them in a new list with
      * increasing scan counts on their expression nodes.  This is done to have
      * the Evaluators with the least scan count which have the highest

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java Wed Apr 11 05:30:46 2012
@@ -30,6 +30,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -45,6 +47,9 @@ import org.apache.directory.shared.ldap.
  */
 public class ApproximateCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = "ApproximateCursors only support positioning by element when a user index exists on the asserted attribute.";
 
@@ -67,6 +72,7 @@ public class ApproximateCursor<V, ID ext
     @SuppressWarnings("unchecked")
     public ApproximateCursor( Store<Entry, ID> db, ApproximateEvaluator<V, ID> approximateEvaluator ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating ApproximateCursor {}", this );
         this.approximateEvaluator = approximateEvaluator;
 
         AttributeType attributeType = approximateEvaluator.getExpression().getAttributeType();
@@ -318,6 +324,7 @@ public class ApproximateCursor<V, ID ext
      */
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing ApproximateCursor {}", this );
         super.close();
 
         if ( userIdxCursor != null )
@@ -329,4 +336,25 @@ public class ApproximateCursor<V, ID ext
             uuidIdxCursor.close();
         }
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing ApproximateCursor {}", this );
+        super.close( cause );
+
+        if ( userIdxCursor != null )
+        {
+            userIdxCursor.close( cause );
+        }
+        else
+        {
+            uuidIdxCursor.close( cause );
+        }
+    }
+
+
 }
\ No newline at end of file

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ChildrenCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ChildrenCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ChildrenCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ChildrenCursor.java Wed Apr 11 05:30:46 2012
@@ -27,9 +27,9 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.ParentIdAndRdn;
 import org.apache.directory.server.xdbm.Store;
-import org.apache.directory.shared.ldap.model.cursor.Cursor;
-import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -40,6 +40,9 @@ import org.apache.directory.shared.ldap.
  */
 public class ChildrenCursor<ID extends Comparable<ID>> extends AbstractIndexCursor<ID, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** Error message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
 
@@ -65,6 +68,7 @@ public class ChildrenCursor<ID extends C
     public ChildrenCursor( Store<Entry, ID> db, ID parentId, IndexCursor<ParentIdAndRdn<ID>,Entry, ID> cursor )
         throws Exception
     {
+        LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
         this.db = db;
         this.parentId = parentId;
         this.cursor = cursor;
@@ -166,6 +170,7 @@ public class ChildrenCursor<ID extends C
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
         cursor.close();
 
         super.close();
@@ -175,6 +180,7 @@ public class ChildrenCursor<ID extends C
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing ChildrenCursor {}", this );
         cursor.close( cause );
 
         super.close( cause );

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java Wed Apr 11 05:30:46 2012
@@ -30,6 +30,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -43,6 +45,9 @@ import org.apache.directory.shared.ldap.
  */
 public class EqualityCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_714 );
 
@@ -65,6 +70,7 @@ public class EqualityCursor<V, ID extend
     @SuppressWarnings("unchecked")
     public EqualityCursor( Store<Entry, ID> db, EqualityEvaluator<V, ID> equalityEvaluator ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating EqualityCursor {}", this );
         this.equalityEvaluator = equalityEvaluator;
 
         AttributeType attributeType = equalityEvaluator.getExpression().getAttributeType();
@@ -319,6 +325,7 @@ public class EqualityCursor<V, ID extend
      */
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing EqualityCursor {}", this );
         super.close();
 
         if ( userIdxCursor != null )
@@ -330,4 +337,23 @@ public class EqualityCursor<V, ID extend
             uuidIdxCursor.close();
         }
     }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing EqualityCursor {}", this );
+        super.close( cause );
+        
+        if ( userIdxCursor != null )
+        {
+            userIdxCursor.close( cause );
+        }
+        else
+        {
+            uuidIdxCursor.close( cause );
+        }
+    }
 }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java Wed Apr 11 05:30:46 2012
@@ -30,6 +30,8 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -43,6 +45,9 @@ import org.apache.directory.shared.ldap.
  */
 public class GreaterEqCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private static final String UNSUPPORTED_MSG = "GreaterEqCursors only support positioning by element when a user index exists on the asserted attribute.";
 
     /** An greater eq evaluator for candidates */
@@ -52,14 +57,14 @@ public class GreaterEqCursor<V, ID exten
     private final IndexCursor<V, Entry, ID> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String, Entry, ID> ndnIdxCursor;
+    private final IndexCursor<String, Entry, ID> uuidIdxCursor;
 
     /**
-     * Used to store indexEntry from ndnCandidate so it can be saved after
+     * Used to store indexEntry from uuidCandidate so it can be saved after
      * call to evaluate() which changes the value so it's not referring to
      * the NDN but to the value of the attribute instead.
      */
-    IndexEntry<String, ID> ndnCandidate;
+    private IndexEntry<String, ID> uuidCandidate;
 
 
     /**
@@ -71,6 +76,7 @@ public class GreaterEqCursor<V, ID exten
     @SuppressWarnings("unchecked")
     public GreaterEqCursor( Store<Entry, ID> db, GreaterEqEvaluator<V, ID> greaterEqEvaluator ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating GreaterEqCursor {}", this );
         this.greaterEqEvaluator = greaterEqEvaluator;
 
         AttributeType attributeType = greaterEqEvaluator.getExpression().getAttributeType();
@@ -78,11 +84,11 @@ public class GreaterEqCursor<V, ID exten
         if ( db.hasIndexOn( attributeType ) )
         {
             userIdxCursor = ( ( Index<V, Entry, ID> ) db.getIndex( attributeType ) ).forwardCursor();
-            ndnIdxCursor = null;
+            uuidIdxCursor = null;
         }
         else
         {
-            ndnIdxCursor = db.getEntryUuidIndex().forwardCursor();
+            uuidIdxCursor = db.getEntryUuidIndex().forwardCursor();
             userIdxCursor = null;
         }
     }
@@ -272,8 +278,8 @@ public class GreaterEqCursor<V, ID exten
         }
         else
         {
-            ndnIdxCursor.beforeFirst();
-            ndnCandidate = null;
+            uuidIdxCursor.beforeFirst();
+            uuidCandidate = null;
         }
 
         setAvailable( false );
@@ -293,8 +299,8 @@ public class GreaterEqCursor<V, ID exten
         }
         else
         {
-            ndnIdxCursor.afterLast();
-            ndnCandidate = null;
+            uuidIdxCursor.afterLast();
+            uuidCandidate = null;
         }
 
         setAvailable( false );
@@ -351,12 +357,12 @@ public class GreaterEqCursor<V, ID exten
             return setAvailable( false );
         }
 
-        while ( ndnIdxCursor.previous() )
+        while ( uuidIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            ndnCandidate = ndnIdxCursor.get();
+            uuidCandidate = uuidIdxCursor.get();
 
-            if ( greaterEqEvaluator.evaluate( ndnCandidate ) )
+            if ( greaterEqEvaluator.evaluate( uuidCandidate ) )
             {
                 return setAvailable( true );
             }
@@ -382,12 +388,12 @@ public class GreaterEqCursor<V, ID exten
             return setAvailable( userIdxCursor.next() );
         }
 
-        while ( ndnIdxCursor.next() )
+        while ( uuidIdxCursor.next() )
         {
             checkNotClosed( "next()" );
-            ndnCandidate = ndnIdxCursor.get();
+            uuidCandidate = uuidIdxCursor.get();
 
-            if ( greaterEqEvaluator.evaluate( ndnCandidate ) )
+            if ( greaterEqEvaluator.evaluate( uuidCandidate ) )
             {
                 return setAvailable( true );
             }
@@ -417,7 +423,7 @@ public class GreaterEqCursor<V, ID exten
 
         if ( available() )
         {
-            return ( IndexEntry<V, ID> ) ndnCandidate;
+            return ( IndexEntry<V, ID> ) uuidCandidate;
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );
@@ -429,6 +435,7 @@ public class GreaterEqCursor<V, ID exten
      */
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing GreaterEqCursor {}", this );
         super.close();
 
         if ( userIdxCursor != null )
@@ -437,7 +444,28 @@ public class GreaterEqCursor<V, ID exten
         }
         else
         {
-            ndnIdxCursor.close();
+            uuidIdxCursor.close();
+            uuidCandidate = null;
+        }
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing GreaterEqCursor {}", this );
+        super.close( cause );
+        
+        if ( userIdxCursor != null )
+        {
+            userIdxCursor.close( cause );
+        }
+        else
+        {
+            uuidIdxCursor.close( cause );
+            uuidCandidate = null;
         }
     }
 }
\ No newline at end of file

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java Wed Apr 11 05:30:46 2012
@@ -30,6 +30,8 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -43,6 +45,9 @@ import org.apache.directory.shared.ldap.
  */
 public class LessEqCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_716 );
 
     /** An less eq evaluator for candidates */
@@ -55,16 +60,17 @@ public class LessEqCursor<V, ID extends 
     private final IndexCursor<V, Entry, ID> uuidIdxCursor;
 
     /**
-     * Used to store indexEntry from ndnCandidate so it can be saved after
+     * Used to store indexEntry from uudCandidate so it can be saved after
      * call to evaluate() which changes the value so it's not referring to
-     * the NDN but to the value of the attribute instead.
+     * the UUID but to the value of the attribute instead.
      */
-    IndexEntry<V, ID> ndnCandidate;
+    private IndexEntry<V, ID> uuidCandidate;
 
 
     @SuppressWarnings("unchecked")
     public LessEqCursor( Store<Entry, ID> db, LessEqEvaluator<V, ID> lessEqEvaluator ) throws Exception
     {
+        LOG_CURSOR.debug( "Creating LessEqCursor {}", this );
         this.lessEqEvaluator = lessEqEvaluator;
 
         AttributeType attributeType = lessEqEvaluator.getExpression().getAttributeType();
@@ -281,7 +287,7 @@ public class LessEqCursor<V, ID extends 
         else
         {
             uuidIdxCursor.beforeFirst();
-            ndnCandidate = null;
+            uuidCandidate = null;
         }
 
         setAvailable( false );
@@ -301,7 +307,7 @@ public class LessEqCursor<V, ID extends 
         else
         {
             uuidIdxCursor.afterLast();
-            ndnCandidate = null;
+            uuidCandidate = null;
         }
 
         setAvailable( false );
@@ -339,14 +345,14 @@ public class LessEqCursor<V, ID extends 
         while ( uuidIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            ndnCandidate = uuidIdxCursor.get();
-            if ( lessEqEvaluator.evaluate( ndnCandidate ) )
+            uuidCandidate = uuidIdxCursor.get();
+            if ( lessEqEvaluator.evaluate( uuidCandidate ) )
             {
                 return setAvailable( true );
             }
             else
             {
-                ndnCandidate = null;
+                uuidCandidate = null;
             }
         }
 
@@ -384,15 +390,15 @@ public class LessEqCursor<V, ID extends 
         while ( uuidIdxCursor.next() )
         {
             checkNotClosed( "next()" );
-            ndnCandidate = uuidIdxCursor.get();
+            uuidCandidate = uuidIdxCursor.get();
 
-            if ( lessEqEvaluator.evaluate( ndnCandidate ) )
+            if ( lessEqEvaluator.evaluate( uuidCandidate ) )
             {
                 return setAvailable( true );
             }
             else
             {
-                ndnCandidate = null;
+                uuidCandidate = null;
             }
         }
 
@@ -416,7 +422,7 @@ public class LessEqCursor<V, ID extends 
 
         if ( available() )
         {
-            return ndnCandidate;
+            return uuidCandidate;
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );
@@ -425,6 +431,7 @@ public class LessEqCursor<V, ID extends 
 
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing LessEqCursor {}", this );
         super.close();
 
         if ( userIdxCursor != null )
@@ -434,7 +441,27 @@ public class LessEqCursor<V, ID extends 
         else
         {
             uuidIdxCursor.close();
-            ndnCandidate = null;
+            uuidCandidate = null;
+        }
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing LessEqCursor {}", this );
+        super.close( cause );
+        
+        if ( userIdxCursor != null )
+        {
+            userIdxCursor.close( cause );
+        }
+        else
+        {
+            uuidIdxCursor.close( cause );
+            uuidCandidate = null;
         }
     }
 }
\ No newline at end of file

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java Wed Apr 11 05:30:46 2012
@@ -29,6 +29,8 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,6 +40,9 @@ import org.apache.directory.shared.ldap.
  */
 public class NotCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 );
     private final IndexCursor<V, Entry, ID> uuidCursor;
     private final Evaluator<? extends ExprNode, Entry, ID> childEvaluator;
@@ -47,6 +52,7 @@ public class NotCursor<V, ID extends Com
     public NotCursor( Store<Entry, ID> store, Evaluator<? extends ExprNode, Entry, ID> childEvaluator )
         throws Exception
     {
+        LOG_CURSOR.debug( "Creating NotCursor {}", this );
         this.childEvaluator = childEvaluator;
         this.uuidCursor = ( IndexCursor<V, Entry, ID> ) store.getEntryUuidIndex().forwardCursor();
     }
@@ -142,7 +148,16 @@ public class NotCursor<V, ID extends Com
 
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing NotCursor {}", this );
         super.close();
         uuidCursor.close();
     }
+
+
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing NotCursor {}", this );
+        super.close( cause );
+        uuidCursor.close( cause );
+    }
 }

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java?rev=1324565&r1=1324564&r2=1324565&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java (original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java Wed Apr 11 05:30:46 2012
@@ -31,6 +31,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.name.Rdn;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -41,6 +43,9 @@ import org.apache.directory.shared.ldap.
  */
 public class OneLevelScopeCursor<ID extends Comparable<ID>> extends AbstractIndexCursor<ID, Entry, ID>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** Error message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
 
@@ -72,6 +77,7 @@ public class OneLevelScopeCursor<ID exte
     public OneLevelScopeCursor( Store<Entry, ID> db, OneLevelScopeEvaluator<Entry, ID> evaluator )
         throws Exception
     {
+        LOG_CURSOR.debug( "Creating OneLevelScopeCursor {}", this );
         this.db = db;
         this.evaluator = evaluator;
 
@@ -294,6 +300,13 @@ public class OneLevelScopeCursor<ID exte
     @Override
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing OneLevelScopeCursor {}", this );
+        
+        if ( cursor != null )
+        {
+            cursor.close();
+        }
+        
         scopeCursor.close();
 
         if ( dereferencedCursor != null )
@@ -308,6 +321,13 @@ public class OneLevelScopeCursor<ID exte
     @Override
     public void close( Exception cause ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing OneLevelScopeCursor {}", this );
+        
+        if ( cursor != null )
+        {
+            cursor.close( cause );
+        }
+
         scopeCursor.close( cause );
 
         if ( dereferencedCursor != null )



Mime
View raw message