473,321 Members | 1,669 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,321 software developers and data experts.

Web Services Shared Resource/Memory


How can I share resources across all users of a web service for read/write
access.

*Situation* *one*:

I want to have an in memory counter that all users of the webservice could
access. Call it g_count.

Then I create a web method called Update_g_count.

public int g_count( int incr )
{
g_count += incr;
return g_count;
}

So, how do I define g_count so it's global across all users?

*Situation* *two*:

I have an XML file that I want to load into an XmlDocument.

I want to set up a Web Method that uses XPath to find a node, and then
change the value of the InnerText.

How do I put this XmlDocument into memory so all users can update it without
collisions when they try to update the nodes?

Do I need to use a mutex ?

How can this mutex apply across all users of the web service ?

Do I put it in global.asax ?

--
incognito
http://kentpsychedelic.blogspot.com/
Nov 21 '05 #1
3 2771

That raises a lot of questions for me.

Just what is the potential of the XmlDocument class and XPath methods?

Are the numbers below based on fact, or just finger in the air estimates?

For example -- what is the performance of XPath on large XML documents.

For small documents, it seems lickety-split.

If an XmlDocument is implemented using a b-tree structure, then even for
very large numbers of records the speed of search should not increase by
much, right ?


Kondratyev Denis wrote:
Imho there is not "right" or "recomended" way for all situations. If your
xml document about 10-20 records storing in application object is good
idea. But if you have huge document with 10000 nodes you can store it in
DB. Or you can store data in DB if you data is VERY important and you want
it from server critical errors.

"Donnie Darko" <cu*****@visions.cellar.door> ???????/???????? ? ????????
?????????: news:25****************@news.west.earthlink.net...

You say that this is not a 'recommended' way to share resources in web
applications.

Can you suggest a recommended way?

Specifically, I want to share access to an XmlDocument across all users
of
my web service. I want them to be able to query and update nodes on the
document.


--
incognito @ http://kentpsychedelic.blogspot.com/

Man is the best computer we can put aboard a spacecraft ... and the only one
that can be mass produced with unskilled labor. -- Werner von Braun
Nov 21 '05 #2
hi Donnie,

I'm not sure about the speed in the b-tree structure but i know that the memory consumption for XMLDocument is according to the following:

DOM and DataDOM overhead is per node. Node size is minimal .
- XmlNode: 4 bytes for parentNode
- +4 bytes for nodes that can have a next-sibling (which is prety much
everything)
- +4 bytes for nodes that have children - mostly XmlElement/XmlAttribute).
- + your data.

so maybe you can use this to calculate it? i also found the following KBs along the way and hope it might help you too.

INFO: Roadmap for Executing XPath Queries in .NET Applications
Article ID : 313828

INFO: Roadmap for XML in the .NET Framework
Article ID : 313651

HOW TO: Use the System.Xml.XmlDocument Class to Run XPath Queries in Visual Basic .NET (317018)
PRB: XSL Transformations with XmlDataDocument May Perform More Slowly Than XPathDocument (318580)

Hope that helps,

Michelle

***Disclaimer: This posting is provided "as is" with no warranties and confers no rights.***
--------------------
Message-Id: <11****************@news.west.earthlink.net>
From: Donnie Darko <cu*****@visions.cellar.door>
Subject: Re: Web Services Shared Resource/Memory

That raises a lot of questions for me.

Just what is the potential of the XmlDocument class and XPath methods?

Are the numbers below based on fact, or just finger in the air estimates?

For example -- what is the performance of XPath on large XML documents.

For small documents, it seems lickety-split.

If an XmlDocument is implemented using a b-tree structure, then even for
very large numbers of records the speed of search should not increase by
much, right ?


Kondratyev Denis wrote:
Imho there is not "right" or "recomended" way for all situations. If your
xml document about 10-20 records storing in application object is good
idea. But if you have huge document with 10000 nodes you can store it in
DB. Or you can store data in DB if you data is VERY important and you want
it from server critical errors.

"Donnie Darko" <cu*****@visions.cellar.door> ???????/???????? ? ????????
?????????: news:25****************@news.west.earthlink.net...

You say that this is not a 'recommended' way to share resources in web
applications.

Can you suggest a recommended way?

Specifically, I want to share access to an XmlDocument across all users
of
my web service. I want them to be able to query and update nodes on the
document.


--
incognito @ http://kentpsychedelic.blogspot.com/

Man is the best computer we can put aboard a spacecraft ... and the only one
that can be mass produced with unskilled labor. -- Werner von Braun
Nov 23 '05 #3
Another aspect to consider is that there is no concurrency control when
you access an XmlDocument from multiple threads. You would have to
implement your own locking and possibly your own indexing if the
XPathDocument query speed isn't sufficient for you.

Any reasons you cannot store the data in a database (MSDE would be free,
SQL 2005 Express will be free and has great support for storing and
querying XML documents).

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: Michelle Hlaing [mailto:i-****@online.microsoft.com]
Posted At: Tuesday, January 18, 2005 1:30 AM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Web Services Shared Resource/Memory
Subject: Re: Web Services Shared Resource/Memory

hi Donnie,

I'm not sure about the speed in the b-tree structure but i know that the memory consumption for XMLDocument is according to the following:

DOM and DataDOM overhead is per node. Node size is minimal .
- XmlNode: 4 bytes for parentNode
- +4 bytes for nodes that can have a next-sibling (which is prety much
everything)
- +4 bytes for nodes that have children - mostly XmlElement/XmlAttribute). - + your data.

so maybe you can use this to calculate it? i also found the following KBs along the way and hope it might help you too.

INFO: Roadmap for Executing XPath Queries in .NET Applications
Article ID : 313828

INFO: Roadmap for XML in the .NET Framework
Article ID : 313651

HOW TO: Use the System.Xml.XmlDocument Class to Run XPath Queries in
Visual Basic .NET (317018)
PRB: XSL Transformations with XmlDataDocument May Perform More Slowly Than XPathDocument (318580)

Hope that helps,

Michelle

***Disclaimer: This posting is provided "as is" with no warranties and
confers no rights.***
--------------------
Message-Id: <11****************@news.west.earthlink.net>
From: Donnie Darko <cu*****@visions.cellar.door>
Subject: Re: Web Services Shared Resource/Memory

That raises a lot of questions for me.

Just what is the potential of the XmlDocument class and XPath methods?

Are the numbers below based on fact, or just finger in the air estimates?
For example -- what is the performance of XPath on large XML documents.
For small documents, it seems lickety-split.

If an XmlDocument is implemented using a b-tree structure, then even for very large numbers of records the speed of search should not increase by much, right ?


Kondratyev Denis wrote:
Imho there is not "right" or "recomended" way for all situations. If your
xml document about 10-20 records storing in application object is good
idea. But if you have huge document with 10000 nodes you can store it in DB. Or you can store data in DB if you data is VERY important and you want
it from server critical errors.

"Donnie Darko" <cu*****@visions.cellar.door> ???????/???????? ?
???????? ?????????: news:25****************@news.west.earthlink.net...

You say that this is not a 'recommended' way to share resources in web applications.

Can you suggest a recommended way?

Specifically, I want to share access to an XmlDocument across all users of
my web service. I want them to be able to query and update nodes

on the document.

--
incognito @ http://kentpsychedelic.blogspot.com/

Man is the best computer we can put aboard a spacecraft ... and the

only one
that can be mass produced with unskilled labor. -- Werner von Braun

Nov 23 '05 #4

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

Similar topics

6
by: Grandpa Pete | last post by:
How can I share resources across all users of a web service for read/write access. *Situation* *one*: I want to have an in memory counter that all users of the webservice could access. Call...
2
by: Simon Lok | last post by:
Hi, Is there a distributed shared memory toolkit / API / SDK available for C#? I am looking for the C# equivalent of the JSDT (http://java.sun.com/products/java-media/jsdt/) where basically...
7
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. What are the implications, (in terms of memory, application footprint, resource use, threading, and so forth), of using Shared methods? These Shared classes raise...
3
by: Default User | last post by:
I work in software research and developement in the aerospace industry. We're assisting a project where they are interested in looking at web services in an embedded system. This would most likely...
3
by: Blubaugh, David A. | last post by:
To All, I was wondering if it was possible to utilize python to share a memory resource between a linux and windows system?? It should be stated that both the Linux (CENTOS 5) and windows...
0
by: Blubaugh, David A. | last post by:
Diez, What you have said is extremely concerning. I am now using VMware. With Linux as the Master and windows as the guest operating system. I was wondering if you have ever had to develop...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.