473,396 Members | 2,098 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,396 software developers and data experts.

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 1028
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
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...
2
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...
5
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....
11
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...
0
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...
0
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...
3
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
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...
1
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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...
0
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,...
0
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...
0
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...
0
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...

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.