Reading an resource XML file...

Discussion in 'ASP .Net' started by news.bellatlantic.net, Nov 13, 2004.

  1. I created a class that populates a bunch of its properties from an XML file
    on the file system. I'm planning on using the class on a bunch of sites all
    working off the same XML file. In testing the idea, it looks like if two
    users open a page that accesses the file one user will be locked out of the
    file.

    Is this a case for threading? How can I make sure that any number of people
    can access the XML file at the same time?

    Thanks for any ideas.
     
    news.bellatlantic.net, Nov 13, 2004
    #1
    1. Advertising

  2. news.bellatlantic.net

    Scott Allen Guest

    If the XML file is not going to change I'd would just read the
    contents into the class and store the class in the Cache object. Then
    instead of individual user requests opening the file, they will access
    an object already in memory (I'm assuming the properties are valid for
    all users on the site, not just a single user).

    Even if the XML file changes you could wire up a CacheDependancy
    object to watch for changes and reload the object in cache if someone
    updates the file.

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

    On Fri, 12 Nov 2004 19:29:53 -0500, "news.bellatlantic.net"
    <> wrote:

    >I created a class that populates a bunch of its properties from an XML file
    >on the file system. I'm planning on using the class on a bunch of sites all
    >working off the same XML file. In testing the idea, it looks like if two
    >users open a page that accesses the file one user will be locked out of the
    >file.
    >
    >Is this a case for threading? How can I make sure that any number of people
    >can access the XML file at the same time?
    >
    >Thanks for any ideas.
    >
     
    Scott Allen, Nov 13, 2004
    #2
    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. Dirc Khan-Evans
    Replies:
    1
    Views:
    933
    Karl Seguin
    Oct 17, 2005
  2. avishosh
    Replies:
    2
    Views:
    10,706
    avishosh
    Aug 8, 2004
  3. =?Utf-8?B?a3Nlbg==?=
    Replies:
    0
    Views:
    415
    =?Utf-8?B?a3Nlbg==?=
    May 31, 2006
  4. Sabiyur
    Replies:
    6
    Views:
    496
    Sabiyur
    Dec 22, 2007
  5. Heinrich Moser
    Replies:
    1
    Views:
    478
    Heinrich Moser
    Mar 27, 2008
Loading...

Share This Page