Re: Renewing IndexSearcher on index change.

2005-10-05 Thread Olivier Jaquemet
J.J. Larrea wrote: At 6:39 PM +0200 10/4/05, Olivier Jaquemet wrote: In every case I think I will use this to prevent any problem but why nobody uses finalize methods? is it somehow bad to try to close things correctly that way? Because they are not run under "brutal termination" co

RE: Renewing IndexSearcher on index change.

2005-10-04 Thread Vanlerberghe, Luc
m: Olivier Jaquemet [mailto:[EMAIL PROTECTED] Sent: dinsdag 4 oktober 2005 18:39 To: java-user@lucene.apache.org Subject: Re: Renewing IndexSearcher on index change. Volodymyr Bychkoviak wrote: > I'm using following code during program startup [...] > but this method should be used if you

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread J.J. Larrea
Oops! Yes that's correct. Thanks for catching it... - J.J. At 10:33 AM -0700 10/4/05, Chris Hostetter wrote: >: // feebly try to prevent concurrent reentry problems >: IndexWriter w = writer; >: w = null; >: try { >: w.c

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread Chris Hostetter
: // feebly try to prevent concurrent reentry problems : IndexWriter w = writer; : w = null; : try { : w.close(); Just to clarify for the folks at home, I'm pretty sure you ment... IndexWriter w = write

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread J.J. Larrea
At 6:39 PM +0200 10/4/05, Olivier Jaquemet wrote: >In every case I think I will use this to prevent any problem but why nobody >uses finalize methods? is it somehow bad to try to close things correctly that >way? Because they are not run under "brutal termination" conditions. For that you need

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread Olivier Jaquemet
Volodymyr Bychkoviak wrote: I'm using following code during program startup [...] but this method should be used if you are running only one instance of such program (because one program can unlock index locked by another program for indexing for example) Okay this perfect for our applica

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread Volodymyr Bychkoviak
Olivier Jaquemet wrote: Thank you very much Volodymyr! Exactly the perfect answer I needed. One last question: how do you manage brutal interruption of you program? Cause as far as I am concerned, if I don't use a finalize method in which I close opened searchers, if for some reason the jvm

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread Olivier Jaquemet
Thank you very much Volodymyr! Exactly the perfect answer I needed. One last question: how do you manage brutal interruption of you program? Cause as far as I am concerned, if I don't use a finalize method in which I close opened searchers, if for some reason the jvm terminates, on next run of

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread Volodymyr Bychkoviak
Hi Olivier! In my code i'm using following IndexSearcher extention: public class IndexSearcherWrapper extends IndexSearcher { private int referenceCount; private final IndexReader indexReader; public IndexSearcherWrapper(IndexReader indexReader) { super(indexReader); this.indexReader

Re: Renewing IndexSearcher on index change.

2005-10-04 Thread Olivier Jaquemet
any thoughts on this subjects ? Olivier Jaquemet wrote: Hi all, As I read it on LIA, and as it has already been said on the mailing list multiple times, you only need one IndexSearcher for all your thread, and when your index change, you just need to create a new one to reflect changes. O

Renewing IndexSearcher on index change.

2005-10-02 Thread Olivier Jaquemet
Hi all, As I read it on LIA, and as it has already been said on the mailing list multiple times, you only need one IndexSearcher for all your thread, and when your index change, you just need to create a new one to reflect changes. Otis said in this post you could replaced old searcher and l