This is really a java-user sort of question.

Likely you had your JVM crash / get killed while it was indexing? Which then leaves the lock file in the temp directory. Lucene's locking is based on existence of that lock file.

If there is a time in your app (eg on startup) when you are certain there is no other writer writing to the index, you can do this:

  IndexReader.unlock(directory)

which forcefully removes the lock if if it's present.

Newer versions of Lucene (starting with 2.1) let you pick a LockFactory that implements your locking. If you pick NativeFSLockFactory, then, even when the JVM crashes, the lock will be properly released.

Mike

Sandeep K wrote:


Hi all...
I am having a problem with lucene lock files.
Apache Tomcat is my server. My search functionality was very well working.
but some how a lock file was created in /opt/apache.../temp directory.
after that indexing failed.
can anyone tell me why and when this lock file was created.
It started working when I shut the server down and deleted the lock file.
But I am afraid that in future also this will make a problem.
How can I avoid this?
plz help me.

Thanks and Regards,
Sandeep
--
View this message in context: http://www.nabble.com/Lucene-lock- file-created-tp14659006p14659006.html Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to