lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: Lock obtain timed out
Date Wed, 26 Jul 2006 17:39:17 GMT
On Wed, 2006-07-26 at 16:24 +0200, Björn Ekengren wrote:
> When I close my application containing index writers the
> lock files are left in the temp directory causing an "Lock obtain
> timed out" error upon the next restart.

My guess is that you keep a writer open even though there is no activity
involving adding new documents. Unless I have a massive never ending
stream of new data arriving (many thousand per minute) I usually try not
to have an open writer. Opening, adding documents and closing the writer
in iterations.

It will help if you posted some code showing how you handle the writer.

> I am currently trying to do a soulution based on
> Runtime.addShutdownHook(Thread) but I'm not sure that the shutdown
> thread can retrieve the index writer unless it is static. I guess that
> a shutdown hook could try to delete the lock files by guessing the
> file names but it seems a bad solution as well. 

You probably should not have to do that.


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