Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 25752 invoked from network); 2 Jul 2009 07:07:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jul 2009 07:07:17 -0000 Received: (qmail 97552 invoked by uid 500); 2 Jul 2009 07:07:25 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 97505 invoked by uid 500); 2 Jul 2009 07:07:25 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 97495 invoked by uid 99); 2 Jul 2009 07:07:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 07:07:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of simon.willnauer@googlemail.com designates 209.85.217.215 as permitted sender) Received: from [209.85.217.215] (HELO mail-gx0-f215.google.com) (209.85.217.215) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 07:07:14 +0000 Received: by gxk11 with SMTP id 11so2046752gxk.5 for ; Thu, 02 Jul 2009 00:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=m1oE5Q1HISPQHQl4j6cDHZhWtzCweuLFMfIY4y7snO8=; b=WT2bvLRfSNE5q1sNdnOFrUysWUsYw4Keeepx1/r6qWmHdT1uT2nOsNnEjxf1E1PZSt KhssogTQq4HlaTFFlRVQqUgOmtMYXi3wg+FiqtFO0u0XcWHfb4yh7NtFzY7bK5KK3M7F 6OrgnE8kCJjhFK0D8Nkxr7CdXYMxkBHbjnNLc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=Ro26nkyRP+Q2hsTYPc0RaKpaRAqPgzrBcJ8Hc8ifl3iDnsZ/CVEOU4Cx9pvlrISKe0 Vo67rRffljxyg1xGTiyJbJGke4vlCEwGsdX548kUf61jymvGgA0Z9MWF8EbRtakgulR+ oThL5tP7xmQi7RATkTGuQ6J0De8sacqZAbNak= MIME-Version: 1.0 Received: by 10.100.105.4 with SMTP id d4mr15130563anc.39.1246518413043; Thu, 02 Jul 2009 00:06:53 -0700 (PDT) Reply-To: simon.willnauer@gmail.com In-Reply-To: <22fe01c9fae3$42889fa0$710bc30a@sv.us.sonicwall.com> References: <6f4104d80907010057x138028au6dc9e847723d21b6@mail.gmail.com> <22e801c9fa38$33508f80$710bc30a@sv.us.sonicwall.com> <6f4104d80907010509y4739f652ya722e05d2b375235@mail.gmail.com> <22fe01c9fae3$42889fa0$710bc30a@sv.us.sonicwall.com> Date: Thu, 2 Jul 2009 09:06:52 +0200 Message-ID: Subject: Re: IndexWriter From: Simon Willnauer To: java-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Ganesh is right you should check once you webapp is starting up if you keep the writer open as long as you app is up and running. I just mentioned it to make you aware of it and prevent some surprises if the app crashes. simon On Thu, Jul 2, 2009 at 9:03 AM, Ganesh wrote: > No. You should not do this for every document you add or update. > > First time, When you open your writer, if the directory is locked, it wil= l throw LockObtainFailedException, In this case, Unlock it and Open the wri= ter again. > > Regards > Ganesh > > ----- Original Message ----- > From: "Amin Mohammed-Coleman" > To: ; > Sent: Wednesday, July 01, 2009 5:39 PM > Subject: Re: IndexWriter > > >> Hi all >> >> Thanks for your response. =C2=A0I guess when I add or update using the >> indexwriter I need to do the following: >> >> }finally { >> =C2=A0 if (IndexReader.isLocked(directory)) { >> =C2=A0 =C2=A0 IndexReader.unlock(directory); >> =C2=A0 } >> } >> >> >> Cheers >> Amin >> >> >> >> On Wed, Jul 1, 2009 at 11:47 AM, Simon Willnauer < >> simon.willnauer@googlemail.com> wrote: >> >>> You might want to take care of the write.lock file in the index >>> directory if your application breaks down. If you do not close the >>> writer and restart you app you might get an LockObtainFailedException. >>> >>> simon >>> >>> On Wed, Jul 1, 2009 at 12:39 PM, Ganesh wrote: >>> > Yes. Single IndexWriter could be maintained in a App and it could be >>> closed when the App is shutdown. >>> > >>> > Regards >>> > Ganesh >>> > >>> > ----- Original Message ----- >>> > From: "Amin Mohammed-Coleman" >>> > To: >>> > Sent: Wednesday, July 01, 2009 1:27 PM >>> > Subject: IndexWriter >>> > >>> > >>> >> Hi >>> >> >>> >> This question has probably been asked before so apologies for asking= it >>> >> again. =C2=A0Just to confirm that it is ok to use a single index wri= ter in a >>> web >>> >> application and only close that single instance on application shutd= own? >>> =C2=A0As >>> >> the indexwriter is thread safe there is no need for any external >>> >> synchronisation. =C2=A0Am I correct in thinking this? >>> >> >>> >> I have configured via spring a single index writer which is used in = the >>> >> application and I use the same one for adding and updating documents= . >>> =C2=A0This >>> >> index writer is closed when the spring application context shutsdown= . >>> >> >>> >> >>> >> Cheers >>> >> Amin >>> >> >>> > Send instant messages to your online friends >>> http://in.messenger.yahoo.com >>> > >>> > --------------------------------------------------------------------- >>> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >>> > For additional commands, e-mail: java-user-help@lucene.apache.org >>> > >>> > >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >>> For additional commands, e-mail: java-user-help@lucene.apache.org >>> >>> >> > Send instant messages to your online friends http://in.messenger.yahoo.co= m > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org