lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Wechner <michael.wech...@wyona.com>
Subject How to use setWriteLockTimeout(long) when write.lock already exists
Date Tue, 13 Dec 2011 18:36:23 GMT
Hi

According to

http://www.gossamer-threads.com/lists/lucene/java-dev/37421

one cannot overwrite the default write lock timeout of 1000ms once a 
write.lock already exists (for example inside a multi-threaded 
web-application), because in order to use the method  
setWriteLockTimeout(long)  one would have to
first create an instance of IndexWriter, but because write.lock already 
exists the creation will throw a LockObtainFailedException and hence 
once does not get an instance.

In the link above "Mike" is mentioned that he will create a Jira issue, 
but it's not clear to me if it ever got created
and/or that somebody tried to improve this. Any idea?

Just as a suggestions, but I think it would be nice if one could create 
an IndexWriter instance without actually opening the index in the first 
place, but rather something like:

IndexWriter iWriter = new IndexWriter();
iWriter.setDirectory(...);
iWriter.setAnalyzer(....);
iWriter.setWriteLockTimeout(75);
iWriter.open(); // or iWriter.checkout();
// do something with the index....
iWriter.close();

WDYT?

Thanks

Michael

---------------------------------------------------------------------
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