Reading an resource XML file...

  • Thread starter Thread starter news.bellatlantic.net
  • Start date Start date
N

news.bellatlantic.net

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.
 
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.
 
Back
Top