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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]