lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: Unlocking an index
Date Wed, 09 Jul 2003 19:39:44 GMT
Moved to lucene-user.

I'm not looking at the source, but my guess is that IOE is thrown in
cases where commit.lock does not exist....?
Anyhow, you may want to call isLocked method before calling unlock
method, in order to attempt forceful unlocking only when the index is
indeed locked.  This is risky business, of course, but it looks like
you are aware of it :)


--- Peter Becker <> wrote:
> Me again...
> I am trying to create a command line option for our tool to force
> index 
> access even if the index is locked. Of course I could remove the lock
> files manually but that doesn't seem to be a good idea since I'd have
> to 
> make some assumptions about the internal workings of your code.
> I tried this (indexLocation = path to index as String):
>   IndexReader.unlock(FSDirectory.getDirectory(indexLocation, false));
> Is that appropriate? Is there any way to avoid the IOException that
> gets 
> thrown about not being able to delete "commit.lock"?
> Thanks,
>   Peter
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message