lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Concurrent access IndexReader / IndexWriter - FileNotFoundException
Date Fri, 08 Jan 2010 12:00:51 GMT
Normally, this (using an IndexReader, [re-]opening a new IndexReader
while an IndexWriter is committing) is perfectly fine.  The reader
searches the point-in-time snapshot of the index as of when it was

But: what filesystem are you using?  NFS presents challenges, for example.


On Fri, Jan 8, 2010 at 5:35 AM, legrand thomas <> wrote:
> Hi,
> I often get a FileNotFoundException when my single IndexWriter commits while the IndexReader
also tries to read. My application is multithreaded (Tomcat uses the business APIs); I firstly
thought the read/write access was thread-safe but I probably forget something.
>  Please help me to understand my mistakes:
> - When should I close the IndexWriter ? Each time I add/update a document or never ?
> - Should my java commit/read methods be synchronized ?
> - Should I lock the directory and what's the best way to do it ?
> I referred to the Lucene FAQ ("why do I sometimes get a FileNotFoundException when I
search and update my index at the same time?") but I did not disable any locking for processes
searching or updating the index.
> I use lucene-2.4.1.
> Thanks in advance,
> Tom

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

View raw message