Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 38664 invoked from network); 1 Sep 2006 11:18:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2006 11:18:41 -0000 Received: (qmail 60433 invoked by uid 500); 1 Sep 2006 11:18:36 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 60108 invoked by uid 500); 1 Sep 2006 11:18:34 -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 60097 invoked by uid 99); 1 Sep 2006 11:18:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2006 04:18:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [66.111.4.26] (HELO out2.smtp.messagingengine.com) (66.111.4.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2006 04:18:33 -0700 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id 0EFF7DA119A for ; Fri, 1 Sep 2006 07:18:12 -0400 (EDT) Received: from heartbeat1.internal ([10.202.2.160]) by frontend3.internal (MEProxy); Fri, 01 Sep 2006 07:18:12 -0400 X-Sasl-enc: bqT8yXkmx4Ld2hqViIqU2wRtJziLdk9tELX6ICdg2GQa 1157109492 Received: from [10.17.4.91] (pool-72-70-33-153.bstnma.fios.verizon.net [72.70.33.153]) by mail.messagingengine.com (Postfix) with ESMTP id 49C8B11171 for ; Fri, 1 Sep 2006 07:18:11 -0400 (EDT) Message-ID: <44F816E4.1070705@mikemccandless.com> Date: Fri, 01 Sep 2006 07:17:56 -0400 From: Michael McCandless User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Lock error attempting update of RAMDirectory index References: <6089447.post@talk.nabble.com> <1157066620.4727.3.camel@localhost> <6091907.post@talk.nabble.com> <1157107579.4727.10.camel@localhost> In-Reply-To: <1157107579.4727.10.camel@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >>> You probably forgot to close an IndexWriter? >> Well, I wish it were that easy...I open one IndexWriter to write the >> documents to the index after it is created, and then call writer.optimize() >> and writer.close(). Your suggestion is a good one in that, from what I've >> read, the writer needs to be closed to release the lock file. Apparently, >> there is more to it than that. Also, this doesn't happen consistently -- >> just occasionally. > > Set a breakpoint, print the stacktrace of a new instance of Exception to > your log, or do something similar in the lock methods of Lucene so you > will find out what code of yours lock and unlocks the index. > > I'm quite convinced you forget to close something. Or perhaps you try to > modify at the same time as you insert documents. Why do you need an IndexWriter at all? Can't you open a single IndexModifier and use to do all adds/deletes against your RAMDirectory? Or maybe I'm not understanding the full context... Mike --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org