473,815 Members | 3,814 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

synchronization of Xml file access in .net Pro

Hi,

Iam trying to develop a solution for my comapny in MS VS Pro, using
C++.net. My work involves extensive usage of xml as well. I use DOM
model for xml opeartions.

Now the problem scenario is that multiple clients might be using my
application as same time and trying to modify/update the same xml file.
Therefore i need a mechanism to provide a synchronous access to the xml
file.

One very obvious solution to this problem is that I use lock on the
file access.
Other solution can invlove some kind of usage of synclock to lock the
block the code accessing/updating the xml file.
But i guess both the solution doesn't seems elegant enough.

I was just wondering whether is there anything provided through which i
can just lock the xml element/node being modified or updated and not
the complete file or any part of code.

Any help or suggestion regarding will be highly appreciated.

Thanking in advance,
Aditya

Dec 1 '05 #1
1 1052
CJ
I just ran into this issue as well and from what i read, you will want
to use a Monitor to block access to the code that is updating the xml.
Monitor is the only lock that appeared to be feasible across multiple
processes although you may want to run logic that allows read access to
the file if you know that there isn't the need for write access for a
specific client. FileStream is good for this where you would open with
FileShare and FileAccess properties which would depend on the
functionality needed at the time.

Hope this helps a little. I personally found that this didnt seem very
scalable if you need that in your design. Another way you might go
about it is to cache the xml with a file dependency where you would
lock against writes to the file on disk but any read requests would
just hit the cache.

Regards,
-CJ

Dec 2 '05 #2

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

Similar topics

2
1680
by: WebRod | last post by:
Hi, i am tyring to find a solution to synchronize 2 environnement for months!! How do you synchonize one (or several!!) production environnement from DEV???? I am looking for a software with these functionnalities: - FTP synchronization - synchronize ONLY updated files!!
2
1719
by: Jonathan \(Pickles\) Sklan-Willis | last post by:
Hi All, I have built 2 VB6-ACCESS XP, programs (ADODC component used). The software works fine, updates the database and all, without any troubles. I however now need to do something else with this. The 2 programs are identical, they are built for 2 offices 200 miles apart, and I want the programs to synchronize the data between the 2, automatically. The 2 computers do not have static IP's, they however do have internet access via...
5
15587
by: Cyrus | last post by:
I have a question regarding synchronization across multiple threads for a Hashtable. Currently I have a Threadpool that is creating worker threads based on requests to read/write to a hashtable. One function of the Hashtable is to iterate through its keys, which apparently is inherently not thread-safe. Other functions of the Hashtable include adding/modifying/deleting. To solve the synchronization issues I am doing two things: 1. Lock...
11
1907
by: Alvin Bruney [MVP] | last post by:
What happens in the case where a mutex is used to protect a file on a windows application, but a unix script running elsewhere attempts to manipulate that file while the mutex is not signaled? Is synchronization enforced over these disparate systems? How? -- Regards, Alvin Bruney
0
3490
by: Rod | last post by:
I orginally posted this to microsoft.public.sqlserver.ce but had not received any responses. I have a CF.NET application (C#) with a SqlCE database. We had originally planned to use SQL Authentication to replicate with the publication and indeed had SQL Authentication working flawlessly. Then our client asked us to use Windows Authentication instead. For incremental changes, Windows authentication works fine. When trying to do the...
0
1982
by: sundman.anders | last post by:
Hi all! I have a question about thread synchronization and c++ streams (iostreams, stringstreams, etc). When optimizing a program for a multicore processor I found that stringstream was causing a LOT of synchronization overhead. After a bit of digging I concluded that this synchronization has to do with the access to a global locale inside the stream. The problem can be seen by running the small distilled benchmark code
3
6936
by: CKKwan | last post by:
Dear All, Can synchronize a class, any function is called and the entire class is locked. Can synchronize a method What if I need to Lock a class only when specific method is call?
15
2745
by: ingejg | last post by:
I am starting to study internet synchronization, and my head is still spinning since internet is not my forte, however my boss is breathing down my neck at the moment. Our company has only one server with fixed IP address provided by our ISP, while the other sites (which I wish in the future hold the replicas databases) have only standard internet connections with Dynamic IP (which means that they change IP addresses, as given by the ISP...
1
1175
by: putrycydestengier | last post by:
Hello everyone. I've got question you may consider simple. Im rather new to C#, and I am not quiet sure about one thing. I've found somewhere, that one of ways of synchronizing access of few threads to one object is by using attribute and ContextBoundObject class derivance. I am not sure how does it work. I mean .. in C/C++, where object of some class may contain OBJECTS of another class, using such an attribute (if it would be possible in...
4
2751
by: maxpirate | last post by:
application is built on an MS Access database utilizing the GUI facilities of MS Access. Copies of this application are used stand alone in 4 different geographical locations.The users in these locations send the respective mdb files to a seperate team for consolidation. The reports from each mdb file is generated separately and consolidated into one single report. We wish to consolidate all the stand alone mdb copies into a single centralized...
0
9735
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9610
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
10408
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...
0
9225
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
7686
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
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5570
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...
0
5708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3886
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.