Reading an resource XML file...

  • Thread starter news.bellatlantic.net
  • 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.
 
S

Scott Allen

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top