lucene-java-user mailing list archives

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

> 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.

OK.

> 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!!

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message