473,507 Members | 8,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML file loaded and stored as cached dataset?

Have loaded balanced web servers that we do not allow to connect to our
database. Content is created and pushed to these sites. I want to add a web
service that may get multiple requests a second depending on peak access. I
have built an XML file from SQL DB and pushed this file to web server. I
want to load XML file at application startup and leave it cached if possible
(it will vary in size from 1-2MB) and treat it like an SQL table (rows &
columns) that I can filter on and send XML subset back to caller. Maybe I
should keep XML document loaded as XML Doc and pull my nodes/data from there
and send it out.

I'm concerned also about limitations caused by concurrent access to data.

regards,

doug
Mar 16 '07 #1
7 3354
Hi Doug,

Have you considered loading data from XML file as Dataset and caching it?
About how to load dataset from xml, you can reference.
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
[Loading a DataSet from XML]

If you use XML document rather than Dataset, I think you will lose many
useful features such as relationships, primary key, foreign key, and the
data type...
Additionally, It will become very difficult for you to get related rows.
You will lose the ability to know what type for each column. ..

Have a great weekend,
Sincerely,
Wen Yuan

Mar 16 '07 #2
I'll give it a try. Thanks. May take a few days to respond back.

doug

""WenYuan Wang"" wrote:
Hi Doug,

Have you considered loading data from XML file as Dataset and caching it?
About how to load dataset from xml, you can reference.
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
[Loading a DataSet from XML]

If you use XML document rather than Dataset, I think you will lose many
useful features such as relationships, primary key, foreign key, and the
data type...
Additionally, It will become very difficult for you to get related rows.
You will lose the ability to know what type for each column. ..

Have a great weekend,
Sincerely,
Wen Yuan

Mar 16 '07 #3
I have asked our web support group to verify thier standards are current.
Current standards state "absolutely NO View State" and Datasets should NOT be
used for web service or any high performance tasks. Is their another option?
Recall, no direct access to RDBMS, just a pre-built and staged XML file to
filter on to send XML packet response.

doug

""WenYuan Wang"" wrote:
Hi Doug,

Have you considered loading data from XML file as Dataset and caching it?
About how to load dataset from xml, you can reference.
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
[Loading a DataSet from XML]

If you use XML document rather than Dataset, I think you will lose many
useful features such as relationships, primary key, foreign key, and the
data type...
Additionally, It will become very difficult for you to get related rows.
You will lose the ability to know what type for each column. ..

Have a great weekend,
Sincerely,
Wen Yuan

Mar 20 '07 #4
Hi Doug,
Thanks for your reply.

As far as I know, we have four choices for your scenario.
(DataSet/DataTable, XMLDocument/ XmlReader, XMLDataDocument, XML
Serialization). DataSet is the way to represent data as relational view
and XMLDocument is another way to represent data as hieratical view.
Additionally, the XmlDataDocument class is derived from the XmlDocument
class, providing a hierarchical view of data as well as a relational view
by binding it to a DataSet. The primary purpose of XML serialization in the
..NET Framework is to enable the conversion of XML documents and streams to
common language runtime objects and vice versa.

In general, I would like to suggest you consider using DataSet/DataTable,
but it seems like your current standards restrict you from
DataSet/DataTable. However, now, the choices for us are
XMLDocument/XMLReader and XML serialization, as you said in initial post.
XMLTextReader is the fastest way to get the data via the pull-model XML
parsers.

I noticed there is a question very closed to your issue in WebQA article. I
highly recommend you may reference it.
http://msdn.microsoft.com/msdnmag/issues/02/12/webQA/
Q I'm looking for tips on getting the best performance from my use of the
System.Xml classes in an ASP.NET Web Service. Would I see a benefit from
long-term caching and reuse of System.Xml objects, like XmlDocument?

Additionally, you may meet an issue when using XmlDocument elements passed
to or returned from WebMethods. The following KB will tell the story for
you.
http://support.microsoft.com/kb/330600

Hope this helps. If you still have anything unclear, please feel free to
update here.
Have a great day,
Sincerely,
Wen Yuan

Mar 22 '07 #5
Wen Yuan,

Okay, got web service loading up XML file into dataset and I can send
dataset back to new XML document and return that as my result.

I have 5 layers on my XML. Users will want to select specific level 2 and
level 3 nodes plus child nodes 4 and 5, and parent 1. They will be passing
in an XML packet that has filter criteria level2='6' and level3='B'. I
assume I will load this into dataset also and use the two datasets maybe as a
join where node level values are equal?

How do I select rows from the dataset?

So far, not much code. Very clean. I am enjoying the project.

doug
""WenYuan Wang"" wrote:
Hi Doug,
Thanks for your reply.

As far as I know, we have four choices for your scenario.
(DataSet/DataTable, XMLDocument/ XmlReader, XMLDataDocument, XML
Serialization). DataSet is the way to represent data as relational view
and XMLDocument is another way to represent data as hieratical view.
Additionally, the XmlDataDocument class is derived from the XmlDocument
class, providing a hierarchical view of data as well as a relational view
by binding it to a DataSet. The primary purpose of XML serialization in the
.NET Framework is to enable the conversion of XML documents and streams to
common language runtime objects and vice versa.

In general, I would like to suggest you consider using DataSet/DataTable,
but it seems like your current standards restrict you from
DataSet/DataTable. However, now, the choices for us are
XMLDocument/XMLReader and XML serialization, as you said in initial post.
XMLTextReader is the fastest way to get the data via the pull-model XML
parsers.

I noticed there is a question very closed to your issue in WebQA article. I
highly recommend you may reference it.
http://msdn.microsoft.com/msdnmag/issues/02/12/webQA/
Q I'm looking for tips on getting the best performance from my use of the
System.Xml classes in an ASP.NET Web Service. Would I see a benefit from
long-term caching and reuse of System.Xml objects, like XmlDocument?

Additionally, you may meet an issue when using XmlDocument elements passed
to or returned from WebMethods. The following KB will tell the story for
you.
http://support.microsoft.com/kb/330600

Hope this helps. If you still have anything unclear, please feel free to
update here.
Have a great day,
Sincerely,
Wen Yuan

Mar 28 '07 #6
Hi Doug,
Thanks for your reply.

Dataset will load the xml file into datatables.
For each table, you can select the rows by the method DataTable.Select()
http://msdn2.microsoft.com/en-us/library/det4aw50.aspx
[DataTable.Select Method (String) ]

Additionally, get the rows( from Child/Parent table) related to your
selected rows.
DataRow.GetChildRows
http://msdn2.microsoft.com/en-US/library/hbt8xha8.aspx

DataRow.GetParentRows
http://msdn2.microsoft.com/en-us/library/7bssayw4.aspx

Hope this helps, please feel free to let me know if you still have anything
unclear. I'm glad to assist you.
Have a great day,
Sincerely,
Wen Yuan

Mar 29 '07 #7
This is kind of what I imagined, but hoped it would be simplier. Will give
it a try.

Thanks.

"WenYuan Wang [MSFT]" wrote:
Hi Doug,
Thanks for your reply.

Dataset will load the xml file into datatables.
For each table, you can select the rows by the method DataTable.Select()
http://msdn2.microsoft.com/en-us/library/det4aw50.aspx
[DataTable.Select Method (String) ]

Additionally, get the rows( from Child/Parent table) related to your
selected rows.
DataRow.GetChildRows
http://msdn2.microsoft.com/en-US/library/hbt8xha8.aspx

DataRow.GetParentRows
http://msdn2.microsoft.com/en-us/library/7bssayw4.aspx

Hope this helps, please feel free to let me know if you still have anything
unclear. I'm glad to assist you.
Have a great day,
Sincerely,
Wen Yuan

Mar 29 '07 #8

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

Similar topics

4
2181
by: DJTB | last post by:
Hi, I'm trying to manually parse a dataset stored in a file. The data should be converted into Python objects. Here is an example of a single line of a (small) dataset: 3 13 17 19...
4
443
by: JASV | last post by:
We are opening an excel file using a dataadapter object. The tables included in excel file are loaded into a dataset object. This process works correctly except for this issue: There is an...
1
5860
by: DraguVaso | last post by:
Hi, I found some examples for storing the FormSettings of a Form in an XML-file, but none of these could match my criteria: What I am looking for is the possibility to save the FormSettings of...
2
1399
by: ALPO | last post by:
ANy good examples of paging against a cached dataset. Our datasets will be cached in viewstate.
5
7767
by: Guadala Harry | last post by:
This has to be easy... I have a DataSet stored in the Session object. I simply need to read it later and get the following error: Cannot implicitly convert type 'object' to 'System.Data.DataSet'...
0
1062
by: JenHu | last post by:
Hi experts, I am having trouble calling the cached dataview session and dataview.rowfilter session in the pageIndexChanged event. Currently, if user goes to page 2, the datagrid displays data...
0
999
by: Craig G | last post by:
is there something im doing wrong?? the dataset is cached up until i click a button then when i try to retrieve it, it justs says its nothing!! this is code where it gets inserted into the...
5
7809
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
17
2708
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script...
0
7105
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...
0
7308
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,...
1
7023
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
7479
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...
0
5617
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,...
1
5037
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...
0
3188
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...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
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...

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.