V
Vai2000
Hi All, I am running into a concurrency problem. I have a worker process
which reads some data out of a file and inserts fresh data into it. I have
put a Monitor.Enter(this) and Monitor.Exit(this) on both of the routines
which do read and writes.
The worker process is spawned off by a Multithreaded application. I am
seeing error in log which tells me that
Description:
Stack Trace- at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
at System.Data.DataSet.WriteXml(String fileName, XmlWriteMode mode)
at System.Data.DataSet.WriteXml(String fileName)
Message-The process cannot access the file "C:\WUTemp\foocache.xml" because
it is being used by another process.
Inner Exception-
Source-mscorlib
Base Exception Message-The process cannot access the file
"C:\WUTemp\foocache.xml" because it is being used by another process.
Base Stack Trace- at System.IO.__Error.WinIOError(Int32 errorCode, String
str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
at System.Data.DataSet.WriteXml(String fileName, XmlWriteMode mode)
at System.Data.DataSet.WriteXml(String fileName)
Base Source-mscorlib
Earlier I tried using the Reader and Writer locks too...but ran into timeout
errors...
How do Rectify this?
TIA
which reads some data out of a file and inserts fresh data into it. I have
put a Monitor.Enter(this) and Monitor.Exit(this) on both of the routines
which do read and writes.
The worker process is spawned off by a Multithreaded application. I am
seeing error in log which tells me that
Description:
Stack Trace- at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
at System.Data.DataSet.WriteXml(String fileName, XmlWriteMode mode)
at System.Data.DataSet.WriteXml(String fileName)
Message-The process cannot access the file "C:\WUTemp\foocache.xml" because
it is being used by another process.
Inner Exception-
Source-mscorlib
Base Exception Message-The process cannot access the file
"C:\WUTemp\foocache.xml" because it is being used by another process.
Base Stack Trace- at System.IO.__Error.WinIOError(Int32 errorCode, String
str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
at System.Data.DataSet.WriteXml(String fileName, XmlWriteMode mode)
at System.Data.DataSet.WriteXml(String fileName)
Base Source-mscorlib
Earlier I tried using the Reader and Writer locks too...but ran into timeout
errors...
How do Rectify this?
TIA