473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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 1750
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: siroregano | last post by:
Hi Everyone- I'm new to this group, and almost-as-new to asking programming questions publicly, so please forgive me if I miss a convention or two! I have a text file, around 40,000 lines...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
16
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how...
3
by: frustrated | last post by:
I am trying to share a file stream between two threads, but havent got a clue as to how to do it. The first thread will be reading the file, and the second thread will(/might) be writing to the...
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
3
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
4
by: Dameon | last post by:
Hi All, I have a process where I'd like to search the contents of a file(in a dir) for all occurences (or the count of) of a given string. My goal is to focus more on performance, as some of the...
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
15
by: patf | last post by:
Hi - experienced programmer but this is my first Python program. This URL will retrieve an excel spreadsheet containing (that day's) msci stock index returns. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.