Lucene <= 1.2 creates .lock files in the index directory itself. With >= 1.3 it creates it in (usually /tmp on *NIX systems).

If you get the Exception: Lock obtain timed out

This is because Lucene was unable to open the index becuase it's currently locked.

Note that on Tomcat locks are kept in TOMCAT_HOME/temp and this can become confusing because if you check /tmp there are no lock files.

You can also pass lucene a system property to increase the commit/write lock timeout interval, like so:




The above sets the timeout to one minute.

LockObtainTimedOut (last edited 2009-09-20 21:47:45 by localhost)