You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Alex Karasulu <ao...@bellsouth.net> on 2004/05/01 20:11:29 UTC

[rms][je] BUG: JoinCursor.close() not closing underlying SecondaryCursors

Hi,

I have found a bug where the JoinCursor.close() method does not 
close the underlying SecondaryCursors.  I have filed an issue 
about this bug in our JIRA here:

http://nagoya.apache.org/jira/browse/DIRRMS-95

If you can respond to the JIRA Issue as well as these mailing 
lists that would be great but no worries if its too much of a 
hassle.  The JIRA btw points out the code with the work around 
and how to recreate the problem.

To be complete here's the body of that issue:

Here's the JeIterator with the work around. Notice the constructor 
takes the array of SecondaryCursors for the sake of explicitly 
closing them on the close() call since the JoinCursor.close() 
operation is not doing this for us: 

http://cvs.apache.org/viewcvs.cgi/incubator/directory/rms/trunk/je/src/java/
org/apache/rms/je/JeIterator.java?rev=10481&root=Apache-SVN&view=auto

The problem btw can be recreated just by commenting out the loop 
in the JeIterator.close() method that explicitly closes the 
SecondaryCursors.

Alex




RE: [bdbje] [rms][je] BUG: JoinCursor.close() not closing underlying SecondaryCursors

Posted by Alex Karasulu <ao...@bellsouth.net>.
Mark,

My bad! That makes perfect sense and after looking closer at the Javadocs
its clearer to me.  No problem with the JIRA as far as I'm concerned this 
is a closed matter.

Thanks again,
Alex

> -----Original Message-----
> From: Mark Hayes [mailto:mark@sleepycat.com]
> Sent: Saturday, May 01, 2004 2:35 PM
> To: Alex Karasulu
> Cc: bdbje@sleepycat.com; 'Apache Directory Developers List'
> Subject: Re: [bdbje] [rms][je] BUG: JoinCursor.close() not closing
> underlying SecondaryCursors
> 
> Hi Alex,
> 
> On May 1, 2004, at 11:11 AM, Alex Karasulu wrote:
> 
> > I have found a bug where the JoinCursor.close() method does not
> > close the underlying SecondaryCursors.  I have filed an issue
> > about this bug in our JIRA here:
> >
> > http://nagoya.apache.org/jira/browse/DIRRMS-95
> 
> I'm wondering if this could be a misunderstanding of the
> JoinCursor.close() method.  JoinCursor.close() closes the cursors that
> it opens -- those dup'ed from the array of cursors given -- but it
> doesn't close the original cursors.  This is intentional -- we consider
> that the caller owns the cursors given, so we are careful not to either
> change their position or close them.  The javadoc for
> JoinCursor.close() mentions this, but perhaps it should emphasize it:
> 
> http://www.sleepycat.com/jedocs/java/com/sleepycat/je/
> JoinCursor.html#close()
> --
> public void close()
>             throws DatabaseException
> 
> Closes the cursors that have been opened by this join cursor.
> 
> The cursors passed to Database.join are not closed  by this method, and
> should be closed by the caller.
> --
> 
> > If you can respond to the JIRA Issue as well as these mailing
> > lists that would be great but no worries if its too much of a
> > hassle.  The JIRA btw points out the code with the work around
> > and how to recreate the problem.
> 
> I took a look at this, but I didn't post a response to the JIRA, I'll
> leave that to you if you feel this issue has been resolved.  What do
> you think?
> 
> Mark
> Sleepycat Software




Re: [bdbje] [rms][je] BUG: JoinCursor.close() not closing underlying SecondaryCursors

Posted by Mark Hayes <ma...@sleepycat.com>.
Hi Alex,

On May 1, 2004, at 11:11 AM, Alex Karasulu wrote:

> I have found a bug where the JoinCursor.close() method does not
> close the underlying SecondaryCursors.  I have filed an issue
> about this bug in our JIRA here:
>
> http://nagoya.apache.org/jira/browse/DIRRMS-95

I'm wondering if this could be a misunderstanding of the  
JoinCursor.close() method.  JoinCursor.close() closes the cursors that  
it opens -- those dup'ed from the array of cursors given -- but it  
doesn't close the original cursors.  This is intentional -- we consider  
that the caller owns the cursors given, so we are careful not to either  
change their position or close them.  The javadoc for  
JoinCursor.close() mentions this, but perhaps it should emphasize it:

http://www.sleepycat.com/jedocs/java/com/sleepycat/je/ 
JoinCursor.html#close()
--
public void close()
            throws DatabaseException

Closes the cursors that have been opened by this join cursor.

The cursors passed to Database.join are not closed  by this method, and  
should be closed by the caller.
--

> If you can respond to the JIRA Issue as well as these mailing
> lists that would be great but no worries if its too much of a
> hassle.  The JIRA btw points out the code with the work around
> and how to recreate the problem.

I took a look at this, but I didn't post a response to the JIRA, I'll  
leave that to you if you feel this issue has been resolved.  What do  
you think?

Mark
Sleepycat Software