lucene-java-user mailing list archives

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

According to

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.setWriteLockTimeout(75);; // or iWriter.checkout();
// do something with the index....




To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message