lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Safely closing stale IndexReaders
Date Tue, 05 Oct 2010 16:00:48 GMT
2010/10/5 Mindaugas Žakšauskas <>:

> The key bit: release(searcher) here calls IndexReader.decRef() which
> in turn closes the index when necessary.

Ahh yes.

> This approach has the same disadvantage of object pooling I have
> mentioned in my original email. The "do searching & rendering" phase
> might be split among many classes and/or frameworks (e.g. JSPs) and
> wrapping all that in a single try/finally might be quite awkward.


> What I was trying to achieve was some sort of automatic resource
> management, similar to what java.lang.AutoCloseable brings with JDK 7.
> It seems that the only possible way to do this is using the finalizer method.

Yeah, icky.

> p.s. our office does own a copy of LIA.

Nice, thanks!!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message