BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


SQL XML
Using XML as a Data Store
Creating An XML Based Cache Using COM
Character encoding, a few words on the subject
How to use the ADO Stream object to retrieve SQL2000 XML
How to transfer XML into a plain text file?
Convert XDR to XML
Sort a table using the header of the table
Applying a XSLT stylesheet using the DBMS_XMLQuery package
N:N relationships with DBMS_XMLQuery Package
DBMS_XMLQuery package bind values to produce more than one xml file
Download data from a database in XML
Inserting XML file into a table using DBMS_XMLSave Package
Insert XML file into a table using ADO
How to call out to a COM component's method through XSLT
How to select DISTINCT items from XML via XSLT
How to convert Word (RTF) documents to XML for auto publication
Creating SQL Statements with XSLT
SQL straight to XML w/ transform
History Of XML
History Of XML And What Is XML.


 
 

<< SEOSystem.XML >>


By Shiva
First Posted 08/04/2001
Times viewed 293

XML IMDB Concepts.


Summary In this session of article let us explore the concept of IMDB (In Memory Database) in XML.

Article By

Shiva (Sivasankaran), Senior XML Consultant, www.tecra.com

Introduction

                          No matter whether xml is hyped or not, but undoubtedly it isn’t a hoax! Xml is widely used across every business application running today, it might be xyz2xyz or any other Legacy System. Before dwelling into the core of IMDB concept in XML, let us get a quick hand on the fundamentals.

 Quick Review

  • “anything”.xml – is a text file.
  • Content Oriented
  • User-defined tags
  • Case-Sensitive and Unicode Character Sets.
  • XML plays role in Middleware, Server and Client side.
  • XML specifications are in W3C.org
  • There is lot of Markup languages growing such as MathML, CML, VML (Vector Markup Language), GML, HRXML and a lot more based on XML standards.
  • IE (Internet Explorer) ships along msxml.dll by default. (Check Microsoft site for latest parsers)
  • XPATH – query language to select nodes/node data from xml quickly.
  • XSLT – renders the xml file. If database table is xml then sql is xsl.

  

Related concepts and technologies for the study for this article: VB, ASP, XML, IIS, MSXML3

IMDB – In Memory Database

Instead of fetching data against database or any physical storage repeatedly, the client layer/presentation layer reads/fetches the data stored from the memory. This is one of the fundamental ideas that need to be understood.

XML can be loaded into memory in Client side (For ex: IE browser) and can be loaded in the Server side (using server side script codes) as well.

Client side loading may not provide complete solution depending upon whether it supports XML. And lot more issues, which we cannot have the hold of, whereas there is not much issues regarding Server side.

 When do we need to think about this concept? *

  • In order to reduce client’s frequent visit to certain database tables.
  • In order to avoid loading xml file again and again.
  • In order to Increase Speed Performance, thus reducing network traffic (indirectly).

    * Application needs to be analyzed first, to see where and how to fit this, which tables can be converted to xml files, etc

In Database:

Generate xml data files for the selected tables.

For example let us consider a countries table: (This is not going to change very frequently and it is not worth to fetch the details every time from the database table from asp pages.)

 Countries table contains

Code and Name as columns:

 Code                           Name

91                    India

27                    South Africa

44                    United Kingdom

….

….

Generate countries.xml file for the above

<Countries>

<Country code = ‘91’>

   <Name>India</ Name >

</Country>

<Country code = ‘27’>

   <Name>South Africa</ Name >

</Country>

<Country code = ‘44’>

   <Name>United Kingdom</ Name >

</Country>

…

…

</Countries>

 In Presentation Layer

 ASP (Active Server Pages):

 Irrespective of whether XML is being loaded repeatedly or just once, the data will remain in the memory, and that is the case in IMDB as well.

But do we need to load each and every time?

 Check In global.asa:

You can load the countries.xml in any of the two events: Application or Session events that depend on your application requirements.

   Loading xml file on the application onstart event:

Dim xml_Obj_Countries

Set xml_Obj_Countries = Server.CreateObject(“Microsoft.FreeThreadedXMLDOM”)

 If xml_Obj_Countries.Load(Server.Mappath(“countries.xml”)) then  

   Application(“countries”) = xml_Obj_Countries

End if

 Now you are ready to use this application object anywhere in your asp, and all data will read from the memory.

 Miscellaneous:

1.What happens to application object if the xml file is modified?
          
               Application object doesn’t replicate the changes and it continues to fetch the old values, which is still available in memory.

2.How to update the memory when an xml file is modified?

                Depending on application design, we have to load the xml file again and set that to application object. Thus it is not necessary to load every time, instead load the xml file only when it is modified.

3.You can use UNC path or Server.Mappath. Use the help of FileSystemObjects if you are intended to load xml files in a generic way.

Common Issues:

1.Install msxml3.dll or look for released latest versions, presently xmlinst.exe is provided to use the dll’s in replace mode.
    Run Setup msxml3.exe
    Execute the xmlinst.exe
    Copy the xmlinst in c:\winnt\system32
    In command prompt type c:\winnt\system32> xmlinst msxml3.dll
    regsvr32 msxml3.dll
2.There are two types of model available, rental and free threaded, use the freethreadedxmldom method.
3.Check whether you had included the MIME type “.xml” extension to your IIS.

Conclusions:

    It truly depends on how we fit xml and particularly “IMDB” concept in applications, let me know your feedback on this or suggestions of what further information you require.

Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< SEOSystem.XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML