lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Best Locking approach (Directory Lock)
Date Wed, 02 Dec 2009 13:03:07 GMT
Hi Shai,

> have other uses as well? What about multiple IndexWriters from the same
> JVM?

This also needs a lock. But if it is guaranteed to only have one JVM
accessing the index, you can use an in-JVM-Locking mechanism which is
provided by
http://lucene.apache.org/java/3_0_0/api/all/org/apache/lucene/store/SingleIn
stanceLockFactory.html

> If NoLockFactory is not safe, then we can move to SimpleFSLockFactory, and
> since we can guarantee by other means that only one IndexWriter attempts
> to
> write to the index, we can IndexWriter.unlock(Dir) if the lock exists.

If you can guarantee that you only have *one* JVM and there may be multiple
IndexWriters, use above solution.

Uwe


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