I have an indexing function called "Execute ()", using IndexWriter to index the contents of my site. It works fine if I just called it from a webpage but couldn't when I have it as a delegate parameter in System.Threading.Thread. Strange, however, it always works on my local development computer, it only fails when I boot to the shared host.
This is the error message I received
"Lock commit: SimpleFSLock error ...."
Below is the failed code (but only a failure on the shared host)
Scheduler scheduler = new Scheduler(); System.Threading.Thread schedulerThread = new System.Threading.Thread(scheduler.Execute);
Below is the code that works (it works both on my local computer and on the shared host)
Scheduler scheduler = new Scheduler(); schedulre.Execute();
Now, as one of ppl said, this may be a bad result after a previous debugging session, so before I created the IndexWriter instance, I did
if (IndexReader.IsLocked(indexingFolder)) { log.Debug("it is locked"); IndexReader.Unlock(FSDirectory.GetDirectory(indexingFolder)); } else { log.Debug("it is not locked"); }
and guess what? my journal says it is not blocked.
So now I'm sure that this is caused by System.Thread.Threading, but I just don't know how to fix it.
thanks
Liming
source share