lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From legrand thomas <>
Subject Concurrent access IndexReader / IndexWriter - FileNotFoundException
Date Fri, 08 Jan 2010 10:35:11 GMT

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,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message