lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: CachedSearcher
Date Tue, 16 Jul 2002 16:43:47 GMT
Kelvin Tan wrote:
> If the object has a close() method with public modifier, isn't it a common 
> idiom that client code needs to invoke close() explicitly? If there's no 
> real need to call close, maybe it can be changed to protected?

Yes, that is a common idiom.  In the case of Lucene's FSDirectory, it's still a 
good idea to close it when you know its no longer needed, to minimize the 
number of open files, but sometimes it is difficult to know when it is no 
longer needed.  Finalizers are intended for precisely this purpose.  But you're 
right, probably this should be better documented.

Doug


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message