Oops, I finally see it sorry. I could have sworn that this:

                writer.close();
                searcher.close();
                directory.close();

was this!

                writer.close();
                searcher.close();
                reader.close();
                directory.close();

Sorry, totally works now.

Thanks!

On Jun 28, 2012, at 10:51 PM, Robert Muir wrote:

> That doesnt fix it, that hides your bug. Please re-read what I wrote.
> If your application code looks like this test then you are leaking
> file handles.
> 
> close your indexreader!
> 
> 
> On Thu, Jun 28, 2012 at 10:39 PM, Brendan Grainger
> <[email protected]> wrote:
>> Hi Robert,
>> 
>> Looks like this fixes it:
>> 
>>                MockDirectoryWrapper directory = newDirectory();
>>                directory.setNoDeleteOpenFile(false); // Don't emulate windows
>> 
>> Thanks
>> 
>> Brendan Grainger
>> [email protected]
>> www.kuripai.com
>> 
>> On Jun 28, 2012, at 8:57 PM, Robert Muir wrote:
>> 
>>> On Thu, Jun 28, 2012 at 8:22 PM, Brendan Grainger
>>> <[email protected]> wrote:
>>>> 
>>>> Interestingly, if I change the *** line above to use the deprecated 
>>>> constructor taking just the directory it works fine:
>>>> 
>>> 
>>> its not interesting at all, its the typical contract of a java method.
>>> he who opens it closes it.
>>> 
>>> I'll quote myself again:
>>> 
>>> in this case (where IndexSearcher takes a reader that you passed in),
>>> closing the searcher won't actually close the underlying reader.
>>> you passed it in, so you should be sure to close this reader yourself.
>>> 
>>> 
>>> --
>>> lucidimagination.com
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>> 
>> 
> 
> 
> 
> -- 
> lucidimagination.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

Reply via email to