2010/10/5 Mindaugas Žakšauskas <[email protected]>: > 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: [email protected] For additional commands, e-mail: [email protected]
