I had the same issue, and end up doing my own reference counting using
"acquire/release" strategy.

I used a single instance per searcher, every "acquire" counts +1 and
every "release" count -1, when a index is switched it receives a
"dispose" signal, then the release checks if there are processing
instances, if all releases were made then the last release closes the
searcher.

The interface looked like this:

public interface Acquirable<R> {

        public R acquire();
        public void release();
        public boolean isAcquired();
        public boolean dispose();

}

In my implementation, I use a threadlocal to attach the searcher's
referenced instance (although it's a single instance per index
switch).

Hope it helps...

German-K

On Nov 29, 2007 12:15 PM, Dragon Fly <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> My application needs to close/open the index searcher periodically so that 
> newly added documents are visible.  Is there a way to determine if there are 
> any pending searches running against an index searcher or do I have to do my 
> own reference counting? Thank you.
>
> _________________________________________________________________
> You keep typing, we keep giving. Download Messenger and join the i'm 
> Initiative now.
> http://im.live.com/messenger/im/home/?source=TAGLM

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

Reply via email to