You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Peter Kim <pk...@cymfony.com> on 2005/01/28 23:13:06 UTC
Simple question about concurrency
Hi,
I'm still mostly a beginner, both with Java and Lucene, so I apologize
if this may be dumb questions.
Is making index-modifying operations "safe" as simple just doing the
following?
synchronized (writer) {
while (IndexReader.isLocked(directory))
wait();
writer.addDocument(document);
writer.optimize();
writer.close();
notifyAll();
}
Also, should the IndexWriter or IndexReader be static (since you can't
have more than one open anyways?) or is there a reason to make it
non-static?
Thanks!
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org