I am importing my old blogposts into umbraco using the API. At the same time I have an eventhandler that creates datefolders for me. After 10-15 seconds of importing, I get this error in the eventlog, a big "Server application unavailable" message on the page:
-------------------
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/22/ROOT
Process ID: 2484
Exception: System.IO.IOException
Message: The process cannot access the file 'C:\Documents and Settings\MORTEN\ASPNET\Lokale indstillinger\Temp\lucene-12e99fcf6eebeb93b924d4f5cd37e71f-write.lock' because it is being used by another process.
StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.Delete(String path) at Lucene.Net.Store.FSDirectory.AnonymousClassLock.Release() at Lucene.Net.Index.IndexWriter.Finalize()
---------------------
I am guessing that it happens because the events fire in a new thread, so I am basically creating and publishing nodes in severral threads at the same time.
Have any of you experienced this, and gotten around it? Should I make my import loop slower so that the events get some time to complete, or what would be the way to go?
I have also come across the same error today while importing about 1000 pages from a 3rd party CMS into Umbraco using the API's. I am also creating a folder structure and then importing the documents into this structure.
I will give your line of code a try.. and will post a follow up later :)
I'm having the exact same problems, despite the bit of code suggested above.
Did this solve the problem for you in the end, or did you find another work around.
Ideally I'll like to stop Lucene altogether until our import of lots of nodes is complete and then start it again afterwards. Does anyone know how to do this.
Lucene problem when creating a lot of nodes
I am importing my old blogposts into umbraco using the API. At the same time I have an eventhandler that creates datefolders for me. After 10-15 seconds of importing, I get this error in the eventlog, a big "Server application unavailable" message on the page:
-------------------
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/22/ROOT
Process ID: 2484
Exception: System.IO.IOException
Message: The process cannot access the file 'C:\Documents and Settings\MORTEN\ASPNET\Lokale indstillinger\Temp\lucene-12e99fcf6eebeb93b924d4f5cd37e71f-write.lock' because it is being used by another process.
StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Delete(String path)
at Lucene.Net.Store.FSDirectory.AnonymousClassLock.Release()
at Lucene.Net.Index.IndexWriter.Finalize()
---------------------
I am guessing that it happens because the events fire in a new thread, so I am basically creating and publishing nodes in severral threads at the same time.
Have any of you experienced this, and gotten around it? Should I make my import loop slower so that the events get some time to complete, or what would be the way to go?
can I turn off the lucene indexing all together?
Ok, so I googled a bit, and found that this line of code should disable locking in lucene:
Hi Morten,
I have also come across the same error today while importing about 1000 pages from a 3rd party CMS into Umbraco using the API's. I am also creating a folder structure and then importing the documents into this structure.
I will give your line of code a try.. and will post a follow up later :)
Cheers,
Chris
Hi,
I'm having the exact same problems, despite the bit of code suggested above.
Did this solve the problem for you in the end, or did you find another work around.
Ideally I'll like to stop Lucene altogether until our import of lots of nodes is complete and then start it again afterwards. Does anyone know how to do this.
Cheers
Steve
Hi Steven
The code solved the problem for me, so I didn't dig any further into the matter.
Cheers,
I'm looking into some other options to keep the page alive whilst creating the nodes, I'll see if that helps.
Thanks for your update anyway. It is good to know.
Cheers
Steve
I eventually seem to have cracked the problem by putting the code above in the Application_Start.
Not perfect, but it did not seem to work anywhere else.
Still only tested it a bunch of times so far, so maybe I was just lucky.
Cheers
Steve
is working on a reply...