Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 88993 invoked from network); 16 Apr 2003 20:28:05 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 16 Apr 2003 20:28:05 -0000 Received: (qmail 29245 invoked by uid 97); 16 Apr 2003 20:30:04 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 29238 invoked from network); 16 Apr 2003 20:30:04 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 16 Apr 2003 20:30:04 -0000 Received: (qmail 88707 invoked by uid 500); 16 Apr 2003 20:28:03 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 88694 invoked from network); 16 Apr 2003 20:28:03 -0000 Received: from web12701.mail.yahoo.com (216.136.173.238) by daedalus.apache.org with SMTP; 16 Apr 2003 20:28:03 -0000 Message-ID: <20030416202809.67685.qmail@web12701.mail.yahoo.com> Received: from [216.194.17.194] by web12701.mail.yahoo.com via HTTP; Wed, 16 Apr 2003 13:28:09 PDT Date: Wed, 16 Apr 2003 13:28:09 -0700 (PDT) From: Otis Gospodnetic Subject: Re: IndexReader In a MultiThreaded Env To: Lucene Users List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I don't think so. However, this sounds like a scenario in which you should make your 2 threads communicate. Either through JVM or even something as simple as "I'm done building the index" file. Otis --- Rob Outar wrote: > Hi all, > > I think I tracked down what was a nasty bug. I have 2 threads, my > program > works in the following way, the first time a user tries to access the > index, > if an index does not exists then one is built, otherwise if one is > there it > simply uses it. > > Thread 1 comes along and he tries to query, no index exists > (ndexReader.indexExists(File directory) method) so one is now being > built. > > Thread 2 comes along he checks if an index exists via the > IndexReader.indexExists(File directory) method <-- it returns true > since all > the method does is File.exists(). Since thread one caused an index > to be > built Thread 2 thinks that it is a usable index and tries to run > queries and > modify the index -- all of which fail because the index is still > being > built. > > Is there any method that checks more than if the index directory > simply > exists? Is there way to make sure the index is valid before using > it? > > Let me know. > > Rob > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org