> -----Original Message-----
> From: Tatu Saloranta [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 16, 2003 7:23 AM
> To: Lucene Users List
> Subject: Re: Lock obtain timed out
>
> On Tuesday 16 December 2003 03:37, Hohwiller, Joerg wrote:
> > Hi there,
> >
> > I have not yet got any response about my problem.
> >
> > While debugging into the depth of lucene (really hard to read deep
> insde) I
> > discovered that it is possible to disable the Locks using a System
> > property.
> ...
> > Am I safe disabling the locking???
> > Can anybody tell me where to get documentation about the Locking
> > strategy (I still would like to know why I have that problem) ???
> >
> > Or does anybody know where to get an official example of how to
> > handle concurrent index modification and searches?
>
> One problem I have seen, and am still trying to solve, is that if my
web
> app
> is terminated (running from console during development, ctrl+c on
unix),
> sometimes it seems "commit.lock" file is left. Now problem is that
> apparently
[Anand Stephen] You could attach the current Thread to Runtime shut
down hook and release all resources when (ctrl +c) or the app shuts
down. This works for me.
<code-snip>
Thread t = new Thread(this.getClass().getName()) {
public void run() {
logger.info("Closing Lucene indexer; releasing
resources.");
try {
if (writer != null) {
logger.info("Writer is open closing it!");
writer.close();
}
if (reader != null) {
logger.info("reader is still open, closing
it!");
reader.close();
}
} catch (Exception e) {
logger.info("Error occurred shutting down Lucene
indexer. " + e.getMessage(), e);
}
}
};
Runtime.getRuntime().addShutdownHook(t);
</code-snip>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]