lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Jaquemet <olivier.jaque...@jalios.com>
Subject Re: Renewing IndexSearcher on index change.
Date Wed, 05 Oct 2005 07:41:03 GMT
J.J. Larrea wrote:

>At 6:39 PM +0200 10/4/05, Olivier Jaquemet wrote:
>  
>
>>In every case I think I will use this to prevent any problem but why nobody uses finalize
methods? is it somehow bad to try to close things correctly that way?
>>    
>>
>
>Because they are not run under "brutal termination" conditions.  For that you need to
add a shutdown hook to the Java runtime.  A shutdown hook will run if the runtime process
receives a signal eg. SIGHUP which on Unix occurs if the controlling terminal "hangs up",
etc. It won't get run on a SIGKILL, but nothing will.  It also runs if you get an OutOfMemoryException
or similar problem in the runtime, though there is no guarantee the hook code e.g. close()
won't also fail in that case.
>  
>
[...]

>I'm not sure whether this relates to the IndexSearcher problem you're trying to solve,
but it is certainly useful when indexing.
>  
>
It does clarify a lot of things regarding proper use (close) of 
IndexWriter and IndexSearcher. thanks.



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