Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2007

Tip: Looking for answers? Try searching our database.

XML file loaded and stored as cached dataset?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
doug - 15 Mar 2007 23:59 GMT
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
WenYuan Wang - 16 Mar 2007 13:54 GMT
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
doug - 16 Mar 2007 22:11 GMT
I'll give it a try.  Thanks.  May take a few days to respond back.

doug

> Hi Doug,
>
[quoted text clipped - 12 lines]
> Sincerely,
> Wen Yuan
doug - 20 Mar 2007 23:56 GMT
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

> Hi Doug,
>
[quoted text clipped - 12 lines]
> Sincerely,
> Wen Yuan
WenYuan Wang - 22 Mar 2007 05:47 GMT
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
doug - 28 Mar 2007 14:36 GMT
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

> Hi Doug,
> Thanks for your reply.
[quoted text clipped - 33 lines]
> Sincerely,
> Wen Yuan
WenYuan Wang [MSFT] - 29 Mar 2007 07:38 GMT
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
doug - 29 Mar 2007 13:16 GMT
This is kind of what I imagined, but hoped it would be simplier.  Will give
it a try.

Thanks.

> Hi Doug,
> Thanks for your reply.
[quoted text clipped - 17 lines]
> Sincerely,
> Wen Yuan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.