469,625 Members | 1,089 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

xml file read write question


Say I have an XML file on my website that gets read alot (by a c# aspx page)
but written to occasionally (also by the same c# aspx page) . Its a simple
caching situation based on time. Example: If x minutes have elapsed return
the XML from the file and then rewrite the XML file for the next user and
reset the clock. If x minutes havent elapsed just return the XML from the
file.

Do I need to be concerned for any concurrent read/writes or other
concurrency issues? Say userA comes to the page gets a read, while a
nanosecond later userB goes to the page and triggers a read/write, or
vice-versa. Can I get a deadlock/error? If so what strategy can I use to
avoid it?

Thanks in advance
David
Oct 12 '05 #1
1 1526
Is this a large file that you need to process? Is a single file going to be
used by all your users, or will each user have a separate file?

If they all share the same file, and the file is not too large, then you
might consider putting it in something like an application level variable
(that is the DOM), then make changes to the copy in memory and write it back
to disk. That way the memory copy is always the gold copy and the disk
version is only a backup that could be loaded if the application has to
restart.

"David Arden Stevensonn" <df************@gmail.com> wrote in message
news:Ug******************@twister.nyc.rr.com...

Say I have an XML file on my website that gets read alot (by a c# aspx
page)
but written to occasionally (also by the same c# aspx page) . Its a simple
caching situation based on time. Example: If x minutes have elapsed return
the XML from the file and then rewrite the XML file for the next user and
reset the clock. If x minutes havent elapsed just return the XML from the
file.

Do I need to be concerned for any concurrent read/writes or other
concurrency issues? Say userA comes to the page gets a read, while a
nanosecond later userB goes to the page and triggers a read/write, or
vice-versa. Can I get a deadlock/error? If so what strategy can I use to
avoid it?

Thanks in advance
David

Oct 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by siroregano | last post: by
16 posts views Thread by Timm | last post: by
3 posts views Thread by frustrated | last post: by
12 posts views Thread by Brian Henry | last post: by
3 posts views Thread by nicolasg | last post: by
4 posts views Thread by Dameon | last post: by
AdrianH
1 post views Thread by AdrianH | last post: by
15 posts views Thread by patf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.