0

Got error message when one application is using Lucene index exclusively.

Unhandled Exception: NHibernate.Search.Impl.SearchException: Unable to open IndexWriter for My namespace ---> Lucene.Net.Store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock My Index Path\write.lock

I am just wandering if any of you experienced same problem before?

hardywang
  • 4,864
  • 11
  • 65
  • 101

1 Answers1

2

You probably crashed while the IndexWriter was opened, and the write.lock file was left in the index directory. This file is used by the SimpleFSLockFactory to make sure there is a single IndexWriter opened against a filesystem index at any given time.

Go into your index directory, and delete the write.lock file if NHibernate doesnt deal with it automatically.

Jf Beaulac
  • 5,206
  • 1
  • 25
  • 46
  • When I saw the exception, the write.lock was not found in the index directory at all. – hardywang Feb 16 '12 at 16:47
  • Then I guess NHibernate probably deals with it on its own, by unlocking the Directory when it hits the exception. It would be great to have a Nhibernate expert confirm this. – Jf Beaulac Feb 16 '12 at 16:57
  • My experience is that it doesn't remove it automatically. I'm guessing that you try to index from multiple threads in parallell which isn't allowed. – jishi Feb 21 '12 at 15:33