Alex Karasulu wrote:
On Tue, May 12, 2009 at 2:23 PM, Kiran Ayyagari wrote:

Hi Emmanuel,

The below fix would avoid building of a global cursor on a table and moving
it to appropriate position and at the same time avoiding iterating on all
the values.


 Index:
src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
===================================================================
---
src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(revision 766843)
+++
src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(working copy)
@@ -475,9 +475,8 @@
      */
     public void drop( Long id ) throws Exception
     {
-        Cursor<Tuple<Long,K>> values = reverse.cursor();
+        Cursor<Tuple<Long,K>> values = reverse.cursor( id );
         Tuple<Long,K> tuple = new Tuple<Long,K>( id, null );
-        values.before( tuple );

         while ( values.next() )
         {


P.S :- thanks to Seelmann and Emmanuel without their identification of
problem and
         fix I wouldn't have got this idea.


That's an elegant fix !!!

I applied it yesturday.

I will create a JIRA in order to have it in the release note.

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to