I've an asp.net web application which uses Lucene API for search. Here is the problem scenario:
Events:
- User invokes a Lucene search query thru the web application.
- There is another windows service running which just copies the search index folder to another folder.
When event 2 occurs after event 1 has occurred, I am getting error below while copying the index:
The process cannot access the file 'C:\Indexes\segments.gen'
because it is being used by another process.
What am i missing here?
FYI, am using System.IO.File.Copy
with overwrite set to true to copy index files.