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
0
3/15/2007 10:59:08 PM
dotnet.xml 7266 articles. 0 followers. Follow

7 Replies
412 Views

Similar Articles

[PageSpeed] 25

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

0
v-wywang (104)
3/16/2007 12:54:20 PM
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
> 
> 
0
3/16/2007 9:11:00 PM
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
> 
> 
0
3/20/2007 10:56:16 PM
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

0
v-wywang (104)
3/22/2007 4:47:17 AM
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
> 
> 
0
3/28/2007 1:36:01 PM
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

0
v-wywang (104)
3/29/2007 6:38:44 AM
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
> 
> 
0
3/29/2007 12:16:02 PM
Reply:

Similar Artilces:

Max clinet change to Cache mode per server
Hi, we have 2 Exchange 2003 a-p Cluster on Unisys ES7000 with 9000 mailboxes on each cluster. The Clients work with Outlook XP. We plan a Rollout of Outlook 2003 SP2 with activated Cache Mode. Our Offline Adressbook has abaout 10 MB and one Mailbox a average space of 35 MB. Now my question, how much client can rolled out parallel that the download of the mailbox content has only small impact to the Exchange Server performance ? Has anybody some experiences in this case Thank you Ingo ...

Prohibited File Type?
If someone sends me a picture file as an attachment to an email message I get shown "Prohibited File Type..file deactivated". I can see the pic in the body of the message but can't open and view the picture file by clicking it? Similarly if I try to attach a picture file to a message I send that also gives the same warning both before sending and to the recipient? The files In question are jpg files. Anyone advise please? Tools/Safety/Options/Security Uncheck - do not allow attachments to be save or opened - block images and other external content Check (op...

.xls files opening in IE rather than xls
When opening files downloaded from the web, they are opened in an IE windo rather than the appropriate Office 2003 tool (word, excel, etc.) From a previous post: There's a setting in Windows that you can change. In win98, I can do this: Start Windows Explorer View|Folder Options File Types Tab scroll down to MS Excel Worksheet Select it click the edit button There's an option to "browse in same window". Uncheck it. That's where you can toggle the "confirm open after download", too. How to Configure Internet Explorer to Open Office Documents in the Appr...

Formula not being stored any more
Recently, Excel has stopped storing certain formulae in the formula bar. For example, if I type in say "=3*1/10" Excel will store "=0.3" in the formula bar. This is most inconvenient as I want to be able to tell what the constituent parts of the calculation are. It never used to do this so have I accidentally set an option on somewhere? How do I turn it off again? I couldn't duplicate this. If I typed: =3*1/10 and hit F9 (calculate)--not enter I got: 0.3 You're not getting close to the F9 key (with only portions of your formula selected? (Yeah, I did...

Hidden Folders and Files
I am using Windows XP pro, 2nd, service pack. For some reason, I am now unable to see my hidden files and folders, even though I was able to a short while ago. I don't know what I have done to change this. Under folder options I have selected "Display the contents of system folders" and "Show hidden files and folders" However they are not visible. Any advise? Thanks. leasider<SPAM> wrote: > I am using Windows XP pro, 2nd, service pack. > > For some reason, I am now unable to see my hidden files and folders, > even though I was able to a short ...

How do I install when "file ZF561407.CAB can not be found"
...

Excel 2000: File >> New menu command causes application crash
This is occurring on only one machine on a network! After saving an emailed Excel template to a standard network location for Microsoft templates, when selecting File >> New this installation of Excel 2000 crashes ("Excel not responding" on Close program dialog). On other machines there is no problem. Have "repaired" Microsoft Office using that option from the installation CD-ROM, have removed Excel from Office installation, rebooted and reinstalled Excel. No change on the problem behaviour. Everything else appears to be working just fine in this copy of Excel. We ...

Report Load Error via CRM
I am loading a very basic report that had a complex query but works fine when running it in VS2005. When I attempt to load the report via the CRM 4.0 GUI, I get the following error message: An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support." This report does not have any parameters at all, and the most intense thing are embedded select statements which I have done on other reports. I have instal...

I lost my Access (Office) 2003 disk
I have MS Office 2003 loaded on my computer, but someone stole all my program disks just over a year ago, and now I'm finding that things like the subform wizard doesn't load automatically with the program, but has to be loaded later from the program disk (I'm working out of some tutorial-type books for Access 2003). Is there some way of getting around this? Either just using Access workarounds, or is there some way of getting a hold of these (apparent) add-ins to the program, either on line or on disc? Thanks Rob, I answered your question in the Forms newsgroup, this morning. -...

unable to load help topic
Using Money 2004 deluxe. Asking for help I get "unable to load topic" try again. No help, same responce. I went to MS Knowledge base article 812755. Which says 'clear the cache' Which I did. No help, still 'unable to load topic' Tried asking a 'Microsoft pro', could not get a screen to ask my question. Any suggestions? I cleared both MS IE and my default browser, and tried again, still no help. Seems like I should be able to get 'HELP' I even reloaded the Money program, still no HELP. Thanks for any 'HELP" Walt In microsoft.public.money...

Information Store Crashing
Good Morning All, I got in to work this morning to be told that our Exchange server had stopped working over the weekend. More specifically the Information Store service had died. It takes a while before anyone notices the mail going offline on weekends so I missed the whole thing and couldn't check the server for unusual memory usage or etc.. but after pouring through the event logs the only clue I can find which happens a few seconds before the log reports that 'Information store has terminated unexpectedly' is as follows: Event Type: Error Event Source...

a larger window to view the files
Hello, When I click on the "FILE, OPEN" menu items I get a dialogue box showing a list of all the Excel files on my directory and then I can chose the file I want to open. Often, before I select which file I want, I need to resize the columns (Name, Size, type, modified) within that dialogue box to look at various properties and it would be ever so useful if there existed a Macro or utility that presented the list of files in a somewhat larger window so that I did not need to move the column widths each time. Needless to say, this does not just apply to Excel but that is a prog I ...

Unable to import Quicken file to Money
I am trying to import my QUICKEN 2004 data file (QDATA.QDF) into Money 2004. I followed all the directions and validated the QDATA file first, but NOTHING imports. All I get are messages that indicate "Your Quicken file contained invalid transaction types". The only transactions I have are account (Checking and Savings) transactions - debits and credits. I have tried this a number of times, and downloaded all updates to Money, but nothing ever converts. Can anyone help? You can not import Q2004 into M2004. You'll have to wait a few more days and then import it into M2...

HQ Client and invalid store id\connection issue
Have client with four stores. Running RMS V 2.0. New store is number 4. Have been able to establish connection to HQ but get this message on the log: HQ message contains an invalid store\id connection passowrd. Although the message is quite clear. Where exactly should we be making the adjustments? Thank you veruy much. 2 places: In HQ Manager, Admin/Stores Open properties for Store 4 ( I believe you need to be in Maintenence Mode to do this) Go to connection Schedule Tab - near the bottom of the tab you can enter a password - this is unique to each store. In HQ Client, File/Configurat...

outlook cant find file MSOE.DLL
when i try to open outlook an error msg comes up - cannot locate file MSOE.DLL. when i went to start, find, folder/files and searched for it i found it. how can i fix the problem please help. If you're using XP, it should be in the Documents and Settings\User Name\My Documents\Outlook Express. This implies that it associates with the user who's logged into the system. Are you logging in as User Name in the above example? If not, that's why it can't find it. Further help is available in MSOE.TXT in the same sub-directory. Good Luck! <dinky_devil@hotmail.com> wrote...

get a list of file in a directory
Hi. what would be the best way to return a list of files in a directory. I know in VB you could use the dir function, but what should i use in MFC. Doen anyone know of a class available where I could say return all the file in a certain directory and its sub directories Regards Dylan Take a look at the CFileFind MFC class. -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- "Dylan Franklin" <dyl2000@lineone.net> wrote in message news:eHHBr0MxDHA.2436@TK2MSFTNGP09.phx.gbl... > Hi. > > what would be the best way to return a list of files i...

Mailbox Store
The option to purge a mailbox is not available. How do you clean messages from a mailbox at the MMC? Once the mailbox is deleted using ADUC, you will need to run the Clean Agent on the mailbox store for the store to recognize that the mailbox has been deleted. Once that is done you will have the option to Purge. To run the Clean Up Agent, right-click the MB Store. "Lee Coltharp" <itservices@windsorplace.net> wrote in message news:29dde01c465b6$626e8540$a401280a@phx.gbl... > The option to purge a mailbox is not available. How do > you clean messages from a mailbox at...

Visio File Summary Dialog Box is showing wrong file name and size
Hi all, I am using Visio 2003 ActiveX Control in my application using VB.NET 2005. I am calling "visCmdFileSummaryInfoDlg" Command to open File Summary Dialog Box. Dialog Box is open successfully but it always showing Template file size instead of open file size in General Tab. The information it shows is: Type: Microsoft Visio Drawing Location: Size :(928 bytes) Based on: Template - ValueStreamMap.vst Can any one let me know about any property or way so that it shows correct file size? Thanks Asif Can we assume that the new drawing has been saved to disk before you call th...

2 mirror files with :1 and :2
Not sure how, but have 1 excel file, lets call it FILEA.xls and when I open it, it opens a FILEA:1 and a FILEA:2 workbook. Any change made to FILEA:1 gets repeated in FILEA:2 and vice versa. Looks like some sort of mirroring, or changes being tracked, but track changes is turned off. Any help is appreciated! Hi you've opened two windows of the same workbook (from the window /new window menu) - just close one and then save - this should solve the problem Cheers JulieD "DJR" <DJR@discussions.microsoft.com> wrote in message news:F0F6BDF5-9DC2-486E-947C-ABBB6C4544...

Load Balancing 01-11-06
We are looking to load balancing the CRM application. Is there any additional licensing required in order to do so? Assuming you are using v3.0, you will need a server license for each of the app servers, but there is no additional cost for user licenses. -- Matt Parks MVP - Microsoft CRM "Nahi" <nvsimon@msn.com> wrote in message news:1137021044.651154.10540@z14g2000cwz.googlegroups.com... We are looking to load balancing the CRM application. Is there any additional licensing required in order to do so? Yes 3.0. Thanks! ...

Find UnUsed Stored procedure
I have lots of unused SP in my DB and i'd like to delete them. I need to find them. How can I know that a Stored procedure is not used. (with the tables i look at the DMV). I thought to trace it by a DDL Trigger on the Execute sp event, but there is not such a one... Gal (Gal@discussions.microsoft.com) writes: > I have lots of unused SP in my DB and i'd like to delete them. > I need to find them. > How can I know that a Stored procedure is not used. (with the tables i > look at the DMV). That's a not a trivial question to answer. SQL Server maintains...

Outlook Data File Not Closing Properly
I always get the following error message when starting Outlook 2002 (running Office XP and Windows XP) : "The data file 'outlook' was not closed properly. The file is being checked for problems." I get this message everytime (whether I hibernate or shut down) when I start Outlook. This checking of the file can take anywhere from 30 seconds to 5 minutes and is very frustrating. Anyone have any idea what the issue is ? This started happening just after I installed XP SP3. ...

XML generated from a Dataset with a Relationship established
Hi, I have a dataset with two tables (Order, Item) and a relationship setup to join the tables. I have the nested property of the DataRelation class set to true. When I use the GetXML method the XML looks like this: <Orders> <Order> <OrderID>1</OrderID> <Item> <ItemID>1</ItemID> </Item> <Item> <ItemID>2</ItemID> </Item> </Order> </Orders> But the XML I want it to produce would lokk like this: <Orders> <Order> <OrderID>1</Order...

BP Installation Error
Someone post this question before:- MbfPackager data importation process has failed. please c:\DOCUME~1\ADMIN~1\LOCALS~1\Temp\MbfPackager.Import.NoMerge.Common.xml for more information. Problem: When installing Microsoft Business Portal 2.5. Can anyone help me on this error? I'm installing Business Portal 2.5 Feature Pack on Windows 2003 Standard Edition. And, the BP is reading the Great Plains 8.0 database at another server. Cheers, Emily ...

Want to remove Public Folder store/replicas but see many logons
Hello, I would like to remove a Public Folder Store from a server in my all-Exchange 2003 environment. We have had two Public Folder Stores, but I'd like to use one of those Stores for a Private Store for mailboxes and also because replication between the two servers is problematic. (It's only a few hundred megabytes of infrequently-used data.) I removed the replicas for all Public Folders in the ESM (View Public Folders) then removed replicas for Free/Busy, OAB, and Organization Forms after right-clicking and selecting View System Folders. Still, users showed up under the &q...