"file in use" from XmlDocument.Load

Discussion in 'ASP .Net' started by =?Utf-8?B?ZWswMw==?=, May 10, 2005.

  1. I have a web application that saves/loads XML documents. On occasion, an
    error is logged on the call to XmlDocument.Load: "process cannot access the
    file <filepath here> because it is being used by another process." Why
    should a document read operation have any sort of locking issues - even if
    two users are attempting to read the file at the same time, this should not
    be a problem. I don't think this is happening at the same time as a call to
    XmlDocument.Save on the file either, so I don't believe that is the issue
    (though I'm not sure why that would be a problem in any case).

    The same error has also been raised when trying to load an XML document by
    the application after a new version of the XML file was uploaded via FTP to
    the web server. (The XML document is saved in the application Cache and is
    automatically reloaded when the file changes using the cache dependency
    functionality.)

    Any help on this issue would be appreciated - I have searched many different
    forums and web sites but have not yet found an answer.

    EK
    =?Utf-8?B?ZWswMw==?=, May 10, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?ZWswMw==?=

    Scott Allen Guest

    you might want to try FileMon from SysInternals. The tool will let you
    see the who / what / when of file system activity. Perhaps another
    program, like an AV tool or indexing tool is opening for exclusive
    access.

    http://www.sysinternals.com/ntw2k/source/filemon.shtml

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/


    On Tue, 10 May 2005 07:52:12 -0700, "ek03"
    <> wrote:

    >I have a web application that saves/loads XML documents. On occasion, an
    >error is logged on the call to XmlDocument.Load: "process cannot access the
    >file <filepath here> because it is being used by another process." Why
    >should a document read operation have any sort of locking issues - even if
    >two users are attempting to read the file at the same time, this should not
    >be a problem. I don't think this is happening at the same time as a call to
    >XmlDocument.Save on the file either, so I don't believe that is the issue
    >(though I'm not sure why that would be a problem in any case).
    >
    >The same error has also been raised when trying to load an XML document by
    >the application after a new version of the XML file was uploaded via FTP to
    >the web server. (The XML document is saved in the application Cache and is
    >automatically reloaded when the file changes using the cache dependency
    >functionality.)
    >
    >Any help on this issue would be appreciated - I have searched many different
    >forums and web sites but have not yet found an answer.
    >
    >EK
    Scott Allen, May 10, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?ZWswMw==?=

    vMike Guest

    "ek03" <> wrote in message
    news:...
    > I have a web application that saves/loads XML documents. On occasion, an
    > error is logged on the call to XmlDocument.Load: "process cannot access

    the
    > file <filepath here> because it is being used by another process." Why
    > should a document read operation have any sort of locking issues - even if
    > two users are attempting to read the file at the same time, this should

    not
    > be a problem. I don't think this is happening at the same time as a call

    to
    > XmlDocument.Save on the file either, so I don't believe that is the issue
    > (though I'm not sure why that would be a problem in any case).
    >


    I had a similar problem. It turned out that the file was being lock at the
    time of the FTP load. I solve the problem by adding a small routine to put
    the put the process to sleep for a few seconds if the file is in the process
    of upload, then retry the operation. Hope this helps.
    Mike
    vMike, May 10, 2005
    #3
  4. Thank you for the suggestion - I will try FileMon out.

    "Scott Allen" wrote:

    >
    > you might want to try FileMon from SysInternals. The tool will let you
    > see the who / what / when of file system activity. Perhaps another
    > program, like an AV tool or indexing tool is opening for exclusive
    > access.
    >
    > http://www.sysinternals.com/ntw2k/source/filemon.shtml
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    >
    > On Tue, 10 May 2005 07:52:12 -0700, "ek03"
    > <> wrote:
    >
    > >I have a web application that saves/loads XML documents. On occasion, an
    > >error is logged on the call to XmlDocument.Load: "process cannot access the
    > >file <filepath here> because it is being used by another process." Why
    > >should a document read operation have any sort of locking issues - even if
    > >two users are attempting to read the file at the same time, this should not
    > >be a problem. I don't think this is happening at the same time as a call to
    > >XmlDocument.Save on the file either, so I don't believe that is the issue
    > >(though I'm not sure why that would be a problem in any case).
    > >
    > >The same error has also been raised when trying to load an XML document by
    > >the application after a new version of the XML file was uploaded via FTP to
    > >the web server. (The XML document is saved in the application Cache and is
    > >automatically reloaded when the file changes using the cache dependency
    > >functionality.)
    > >
    > >Any help on this issue would be appreciated - I have searched many different
    > >forums and web sites but have not yet found an answer.
    > >
    > >EK

    >
    >
    =?Utf-8?B?ZWswMw==?=, May 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Erymuzuan Mustapa

    Re: Nested xmldocument, dataset?

    Erymuzuan Mustapa, Aug 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,085
    Erymuzuan Mustapa
    Aug 12, 2003
  2. KathyB
    Replies:
    0
    Views:
    298
    KathyB
    Jul 6, 2003
  3. Shoval Tomer
    Replies:
    0
    Views:
    443
    Shoval Tomer
    Jul 9, 2003
  4. Dave Brown

    XMLDocument.Load Progess

    Dave Brown, Feb 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,529
    Tommy
    Feb 4, 2004
  5. Bob
    Replies:
    0
    Views:
    406
Loading...

Share This Page