Thanks Mike for the reply. I will look into Lucene in Action.
   
  I am not very good at threading. So I was looking if there is any api class 
(even in nightly builds) on top of the IndexReader/IndexWriter that takes care 
of concurrency rules. 
   
  Every developer must be facing this problem of concurrency while programming.
   
  Thanks again.
  -Vasu

Michael McCandless <[EMAIL PROTECTED]> wrote:
  
> If I use IndexReader and IndexWriter class for inserts/updates, then I need 
> to handle the threading issues myself. Is there any other class (even in 
> nightly build) that I can use without having to take care of synchronization.

All this means is your code must ensure only one "writer" (IndexWriter
adding docs or IndexReader removing docs) is open at a time. If you
fail to do so, then the second "writer" you try to create will throw a
"Lock obtain timed out" IOException.

Otherwise these classes are fully thread safe.

The performance caveat in IndexModifier (that you should batch your
deletes and batch your adds) still applies, because you will need to
open/close an IndexReader for the former and an IndexWriter for the
latter.

The Lucene in Action book does a great job describing these
concurrency rules.

Also, you should first test IndexModifier to be really sure its
performance is not sufficient for your needs.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



                        
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.

Reply via email to