title: Why is my Lucene index getting locked?
body: <p>I had an issue with my search not return the results I expect.</p>
  
  <p>I tried to run Luke on my index, but it said it was locked and I needed to Force Unlock it (I'm not a Jedi/Sith though)</p>
  
  <p>I tried to delete the index folder and run my recreate-indicies application but the folder was locked. Using unlocker I've found that there are about 100 entries of w3wp.exe (same PID, different Handle) with a lock on the index.</p>
  
  <p>Whats going on?</p>
  
  <p>I'm doing this in my NHibernate configuration:</p>
  
  <pre><code>c.SetListener(ListenerType.PostUpdate, new FullTextIndexEventListener());
  c.SetListener(ListenerType.PostInsert, new FullTextIndexEventListener());
  c.SetListener(ListenerType.PostDelete, new FullTextIndexEventListener());
  </code></pre>
  
  <p>And here is the only place i query the index:</p>
  
  <pre><code>var fullTextSession = NHibernate.Search.Search.CreateFullTextSession(this.unitOfWork.Session);
  
  var fullTextQuery = fullTextSession.CreateFullTextQuery(query, typeof (Person));
  fullTextQuery.SetMaxResults(100);
  
  return fullTextQuery.List&lt;Person&gt;();
  </code></pre>
  
  <p>Whats going on? What am i doing wrong?</p>
  
  <p>Thanks</p>