Even if it's very briefly whilst opening the index - a writelock is a writelock. If anyone has any trick to work around these locks (how brief they may be), I'd really appreciate it. I really can't tolerate any "mishaps" in this system with regards to index locks. I think I've previously worked around this by catching the locked exception (whatever it throws) and trying again, until it succeeds, but that doesn't feel right for a classy coder.
I think that Lucene is one of the cleanest and nicest API:s ever (have used it for years!), but with an exception for the IndexReader :) Fredrik On 8/30/06, Chris Hostetter <[EMAIL PROTECTED]> wrote:
IndexReaders are "read only" by default ... they obtain a lock on teh index very breifly when they are open to ensure that they get a consistent view of the index, but that lock is then released and the IndexReader ha no further need to lock the index unless you attempt a delete. : Date: Wed, 30 Aug 2006 17:31:32 +0200 : From: Fredrik Andersson <[EMAIL PROTECTED]> : Reply-To: [email protected] : To: [email protected] : Subject: Forcing an IndexReader to read-only : : Hi guys! : : I don't know if I've missed some crucial feature here, but how d'you : actually force an IndexSearcher (and hence, the underlying IndexReader) to : go read-only? The default behaviour now seems to be that the first one to : acquire a lock automatically gets a read/write-lock, instead of leaving that : optional. What's the deal here? : : Thanks, : Fredrik : -Hoss
