473,581 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Do i have a problem? possible multiread from xmlfile

H

I have a dll lib wich contains a static method to read and return a result
from a xmlfile.

But is possible that this dll could be called at the same time from muliple
threads. Is this a problem when its readonly access to the file?

I mean do i need some kind of lock on the method so only one thread can
access it? My thougt was that i would have a problem if the methid should
read from the xmlfile from 2 threads

The method goes like this....

private static string GetUrl(string section, string asmxfile)
{
string CompleteUrl = null;

try
{
XmlDocument m_doc = new XmlDocument();
m_doc.Load("web services.xml");

XmlNode node_webservice url =
m_doc.DocumentE lement.SelectSi ngleNode("//config/webserviceurl") ;
.....
.....
.... etc.
}}

Best reagards
Anders
Nov 15 '05 #1
3 1149
Hi Anders,

When two readers read from the same source they will both
get the same result.

When a reader and a writer access the same data, there is the
problem of who does what when. If there are stages in the process,
the reader may read data which is halfway changed - thus getting
bad data. That's the situation when you need locking.

So you're ok with what you've got.

Regards,
Fergus
Nov 15 '05 #2
> When a reader and a writer access the same data, there is the
problem of who does what when. If there are stages in the process,
the reader may read data which is halfway changed - thus getting
bad data. That's the situation when you need locking.

So you're ok with what you've got.


Perfect. Its just that the idea of having two objects opening the same file
a the same time could give me problems when one of them tried to "close" the
reader while the other still were reading....og something like that :)

Thax for your answere.
Anders, Denmark
Nov 15 '05 #3
Hi Anders,

No worries - each will be closing its own reader.

Regards,
Fergus
Nov 15 '05 #4

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

Similar topics

0
1421
by: Mike Medland | last post by:
Hi, I am currently using Python 2.2.3, apache 1.3.27 and mod_python 2.7.8. Under Solaris 8 on a sun. The configuration appears to be working fine but, the problem that i am having is in parsing xml files, when i do for example: xmlfile = minidom.parse(file) root = xmlfile.childNodes It creates a dom instance but it contains nothing at...
4
5046
by: thead01 | last post by:
I create a dataset, load xmlfile, create dataview (ds.defaultview) and bind it to a datagrid (dataset haschanges property is now 'true'). When a user closes the form I want to check via ds.haschanges if there are pending changes in the dataset. Now returns 'true' always. When I say 'acceptchanges' after loading the xmlfile, the haschanges...
1
1179
by: news.microsoft.com | last post by:
I am writing an XSL file to load a node set with XSL document() function with the syntax as follows: <xsl:variable name="var1" select="document('..\res\xmlfile.xml')/Accounts"/> Unfortunately it's doing nothing. Later I move xmlfile.xml to the same directory as the xsl file, as follows: <xsl:variable name="var1"...
1
11789
by: W. Kacy | last post by:
I am having trouble using XML in an ASP.NET 2.0 webform. Using ASP.NET 2.0 beta 2, I have created a blank web page in a C# website. I have added an XML file (soData.xml), structured as follows: <?xml version = "1.0" encoding="Windows-1252" standalone="yes"?> <VFPData> <ac_sodata> <iono>Vendor</iono> <sodate>2004-03-04</sodate>...
3
1443
by: Wayne Wengert | last post by:
I am trying to run the web page example given in the VSNET 2003 Help for "Introduction to the DOM". I saved the example as an aspx page but when I run it I get the following error which I don't understand. Any pointers will be appreciated. Wayne =========== Error ===================== Compiler Error Message: BC30289: Statement cannot...
0
1119
by: christophe_usenet | last post by:
Hi, I'm new to XML, and i'm trying to make a dummy SAX parser with Xerces-C 2.6.0-3. Unfortunately, though it compiles, it does not produce any output :-( Here is the code: ----------------------------------------------------------------------------- #include <xercesc/parsers/SAXParser.hpp>
8
7603
by: David Nicolson | last post by:
Hi, I wasn't exactly sure where to send this, I don't know if it is a bug in Python or not. This is rare, but it has occurred a few times and seems to be reproducible for those who experience it. Examine this code: This is the output: exceptions.UnicodeDecodeError
1
1558
by: hemendravyas | last post by:
Please help out in following code snippet: For the first time it gives prompt while XmlSchema.Read(). Second time schema_collection_object is not null and so does not enter into this block of code. Please help............ private static XmlSchemaCollection schema_collection_object; private static XmlSchema m_ifschema;
7
8220
by: samelzoro | last post by:
here is a problem in recursion: unexpected result ? by this program I just want to convert xml dom's document object to xml-string. (for all browsers) //load a xml function loadXMLDoc(dname) { var xmlDoc; // code for IE if (window.ActiveXObject)
0
7876
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...
0
8156
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. ...
0
8310
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...
0
8180
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...
0
6563
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...
0
5366
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...
0
3809
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...
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1144
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.