Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 31st, 2003, 03:28 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default Storing data as local file(s) (XML)

The scenario for this process is difficult to test in a single developer environment so I thought I'd throw it up here in the forum to get some feedback.

I recently got a web application set up on a remote web host. I don't have any database back-end available at the moment. Eventually, I'd like to do some basic data collection and would like to use XML for this purpose. I can handle writing what I need to read/change/save XML files. What I am concerned about is the issue of write access the XML file(s). My understanding of IIS (at least from when I was building simpler ASP applications) was that multiple page requests were/are processed sequentially in a first-come first-served basis. This would happen assuming that you have the application running in a single thread in IIS. I could be entirely wrong about this. My specialty is web applications, not web server inner workings :). How this all works in .Net is something I know nothing about, but would like to understand. Furthermore, I don't know how the web host's systems works.

If pages are processed in multiple threads such that many page requests can be processing simultaneously then I can foresee a couple problems:

1. When multiple requests are made to some page that manipulates data, and then the data is saved, some file access error(s) occur.

2. (More significant) Data inconsistencies occur:
    a. Process 1 opens xml file, loads into object.
    b. Process 2 opens xml file, loads into object.
    c. Process 1 saves xml file.
    d. Process 2 saves xml file. It's data is based on the original and will overwrite the changes process 1 made.

I think a way to overcome this problem is to let the data object(s) live at a higher scope. If they were kept in the Application() collection, then multiple processes would be working against the same instance of the object. (This is probably poor form and I'd like feedback regarding it. Furthermore, I know that the host frowns upon storing stuff like this in the application() collection anyway.)

Perhaps the best route I should take is to just fork over the cash (and it's not much anyway) for the basic MS-SQL services.

Thoughts, suggestions, feedback, discussion?

Peter
__________________
-Peter
compiledthoughts.com
twitter/peterlanoie





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple input xml / get data from other xml file elayaraja.s XSLT 3 July 25th, 2008 06:59 AM
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
storing an xml file on to my local machine ruchilalla J2EE 0 April 28th, 2005 01:33 AM
Storing XML (beginner) walteramylee XML 1 March 11th, 2004 05:18 AM
XML Data File matt.fields VB.NET 3 January 29th, 2004 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.