473,799 Members | 3,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Safe Multi User xml updates [best Practices??]

Hello,

Im wondering, what's the best method to allow multpiple users to update an
xml file at once. In my case, generally no user should be editing the same
piece of data at any given time however there may be ten+ users updating the
same xml file at once. The file has grown to somewhere along the lines of 3
MB, but shouldnt get much larger. im afraid that using xmldocument is
beginning to become a costly process with such a large object being cahed and
written so many times

As an example this function uses a stream but leaves the file open for write
procedures as it opens, which is bad I know. I have since changed this to
create a mini template and then persist that to the xml file so I would have
less collisions so i would have less of a chance for a overwrite and even if
it does could be remedied by reposting the mini template.

--My question is how could i implement a similar function that would not
allow collisions but also enable multiple users to hit the file? Would this
be something that I would handle via a recursive update function that retries
each time access is denied or is there a Best Practice around this --

Public Function SetClientInfoVa lue(ByVal idNum As String, ByVal InfoId As
Integer, ByVal NewInfo As String) As Boolean
Dim result As Boolean
Dim xDoc As New XmlDocument
Dim strm As New
System.IO.FileS tream(Resources .MyApp.DataPath & "template.x ml",
IO.FileMode.Ope n, IO.FileAccess.R eadWrite, IO.FileShare.Re adWrite)
xDoc.Load(strm)
strm.Close()
Dim rootNode As XmlElement = xDoc.DocumentEl ement
Dim theNode As XmlElement =
rootNode.Select SingleNode("/clients/client[@id='" &
String.Format(" {0:00000}", idNum) & "']/data/info[@infoid='" & InfoId & "']")
If theNode Is Nothing Then
result = False
Else
theNode.InnerTe xt = NewInfo
xDoc.Save(Resou rces.MyApp.Data Path & "template.x ml")
result = True
End If
Return result
xDoc = Nothing

End Function

Thanks in advance for any info or direction

DrewG
May 7 '07 #1
5 3888
"werD" <we**@discussio ns.microsoft.co mwrote in message
news:C3******** *************** ***********@mic rosoft.com...
Hello,

Im wondering, what's the best method to allow multpiple users to update an
xml file at once.
Under no circumstances would I allow multiple users to update an XML file.
It's just a text file. If you need multiple users to be able to update data,
use a database. For instance SQL Server 2005 Express Edition
(http://www.microsoft.com/sql/edition.../default.mspx).

"SQL Server 2005 Express Edition is the next version of MSDE and is a free,
easy-to-use, lightweight, and embeddable version of SQL Server 2005."
--
John Saunders [MVP]
May 7 '07 #2
Well i have got sql running a large portion of my traffic and im doing this
for a specific section of our company. They dont require the robustness of
sql server nor will my company allow me to run dbms on the web server for
this instance. i use sql express for my own personal ventures but im not
going to be able to lock them into purchasing another license... so my
question remains or so as not to offend anyone can be shifted to

What would be the most cpu cost effective way of manipulating data with
multiple users(but not an unmanageable amount of them) ... better yet lets
say im doing the same Exact thing with access what then.. is it a data
adapter imlooking for or would a recursive method be ?

"John Saunders [MVP]" wrote:
"werD" <we**@discussio ns.microsoft.co mwrote in message
news:C3******** *************** ***********@mic rosoft.com...
Hello,

Im wondering, what's the best method to allow multpiple users to update an
xml file at once.

Under no circumstances would I allow multiple users to update an XML file.
It's just a text file. If you need multiple users to be able to update data,
use a database. For instance SQL Server 2005 Express Edition
(http://www.microsoft.com/sql/edition.../default.mspx).

"SQL Server 2005 Express Edition is the next version of MSDE and is a free,
easy-to-use, lightweight, and embeddable version of SQL Server 2005."
--
John Saunders [MVP]
May 7 '07 #3
"werD" <we**@discussio ns.microsoft.co mwrote in message
news:DB******** *************** ***********@mic rosoft.com...
Well i have got sql running a large portion of my traffic and im doing
this
for a specific section of our company. They dont require the robustness of
sql server nor will my company allow me to run dbms on the web server for
this instance. i use sql express for my own personal ventures but im not
going to be able to lock them into purchasing another license...
What license? It's free.
>so my
question remains or so as not to offend anyone can be shifted to

What would be the most cpu cost effective way of manipulating data with
multiple users(but not an unmanageable amount of them) ... better yet lets
say im doing the same Exact thing with access
If you were doing it with access (did you mean Microsoft Access?) then you'd
be using a database and not having this issue.
--
John Saunders [MVP]
May 8 '07 #4
arg... i meant another sql standard/pro license.. No version of express is to
be Installed on our production web servers...

any input on my question?

"John Saunders [MVP]" wrote:
"werD" <we**@discussio ns.microsoft.co mwrote in message
news:DB******** *************** ***********@mic rosoft.com...
Well i have got sql running a large portion of my traffic and im doing
this
for a specific section of our company. They dont require the robustness of
sql server nor will my company allow me to run dbms on the web server for
this instance. i use sql express for my own personal ventures but im not
going to be able to lock them into purchasing another license...

What license? It's free.
so my
question remains or so as not to offend anyone can be shifted to

What would be the most cpu cost effective way of manipulating data with
multiple users(but not an unmanageable amount of them) ... better yet lets
say im doing the same Exact thing with access

If you were doing it with access (did you mean Microsoft Access?) then you'd
be using a database and not having this issue.
--
John Saunders [MVP]
May 8 '07 #5
ok i didnt read the bottom... I'll just continue with my own solution. I was
just wondering if multiuser xml had been handled and if there were set
practices around it.

obviously they arent so i will continue my user based templates being merged
to the core file as to avoid the limitations of access and to leave out the
overhead of sql.

Thanks
"John Saunders [MVP]" wrote:
"werD" <we**@discussio ns.microsoft.co mwrote in message
news:DB******** *************** ***********@mic rosoft.com...
Well i have got sql running a large portion of my traffic and im doing
this
for a specific section of our company. They dont require the robustness of
sql server nor will my company allow me to run dbms on the web server for
this instance. i use sql express for my own personal ventures but im not
going to be able to lock them into purchasing another license...

What license? It's free.
so my
question remains or so as not to offend anyone can be shifted to

What would be the most cpu cost effective way of manipulating data with
multiple users(but not an unmanageable amount of them) ... better yet lets
say im doing the same Exact thing with access

If you were doing it with access (did you mean Microsoft Access?) then you'd
be using a database and not having this issue.
--
John Saunders [MVP]
May 8 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1412
by: deathyam | last post by:
Hi, I am writing an application in Excel 97 in which the users click a button and data is saved/read to and from an Access 97 database on the LAN. I am concerned about performance because there will be multiple users using it at the same time. Generally my technique for database reads is as follows: -I create parameter queries in the database. Doing so allows me to use a sort of 'function' paradigm. i.e. given x and y, query fn...
2
1856
by: meyousikmann | last post by:
I currently have 2-tier Windows applications that connect directly to Oracle to perform data operations. The connection method that I currently employ is to store user names and passwords (encrypted of course) in an Oracle table. A Windows application requests username and password information from a user. The application then connects to Oracle using a "guest" account that has no privileges other than the ability to query the password...
3
3988
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which step you're on. This all works fine, but I ran into some trouble when I started creating controls dynamically in my code-behind file. Each panel contains a table which is filled with various radio buttons, text fields and the such which are...
3
1673
by: Patrick McGuire | last post by:
I am instantiating several custom objects from a subset of data contained in an XML file. I then might edit these objects and save the changes back to the XML file. However, I want to compare the original state of the objects with the current object data stored in the XML file to alert the user to any changes that were made by other users during the time that the user was making his own edits. So I'm doing this:
5
5772
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone know a good place to start looking for some theory on the subject of multi user applications? I know only bits and pieces, like about transactions, but a compendium of possible approches to multi user programming would be very appreciated!
5
5464
by: Macca | last post by:
Hi, I have a multithreaded app which now needs database storage. I am in the process of designing my Data Access Layer but and was wondering what issues I should look for for in regards to a multi threaded app. My app will be need to initiate access to the database from several places in the Business logic. I'd appreaciate any advice/suggesstions on best practices to avoid problems such as accessing the same method in the data
1
2511
by: maciek | last post by:
Hi, I was wondering if anyone could suggest me a book/article/tutorial on Exception Handling in multi tier Windows Apps. What are the best practices/ways to implement EH in multi tier enviroment. I read some MS Best Practices articles on MSDN. It helped a little, but considering how unexperienced programmer I am, I think I'd need a good sample code and explanation I could follow to fully understand the issue. Thanks in advance.
1
10364
by: Macca | last post by:
Hi I have a N-tier ASP.NET application that uses a data access tier to get data from a database and pass it to the middleware/business tier for processing/filtering and then passes the modified data to the web tier for presentaion. What I would like to do is introduce a cache to the middleware tier to cut down on the round trips to the database.
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10260
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.