Re: Managing MultiReader in multi-treaded application

2010-02-07 Thread Michael McCandless
IncRef/DecRef is the best way to handle this: you have to ensure the reader is not closed until 1) your app wants to close it (eg a reopen has completed), and 2) every query in-flight, that had been using the reader, has completed. Lucene in Action 2 (NOTE: I'm a coauthor) has a class (SearcherMan

Managing MultiReader in multi-treaded application

2010-02-06 Thread Dima Volsky
Hi, I'm trying run a scenario in which I have one index writer and several readers. I use the MultiReader for searching on several indexes. The application is multi-threaded so the MultiReader is accessed from several threads sequentialy. In some stage during the run I get AlreadyClosedExceptio