lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Lock error attempting update of RAMDirectory index
Date Fri, 01 Sep 2006 11:17:56 GMT
>>> 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


Mime
View raw message