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

XML cached document fails intermittantly

I have an XMLdocument which I keep in cache which I use on my page. I use
this function (in a separate dll) to read it from the cache and then read it
from file if the cache is empty. This seems to work 99.9% of the time. But
every couple of days or so the app throws an 'Object reference not set to an
instance of an object.' on the getElementByTagName line below. Can anyone
help on what would cause this problem. And any recomendations how to best
troubleshoot it? Is it a file access issue? Am I using the cache wrong?
Regards.

xmlconfig = getcached_xml_doc(xmlpath, Me.xmlcachename)
nodelist = xmlconfig.GetElementsByTagName("nodes")

Public Function getcached_xml_doc(ByVal strxml As String, ByVal strcachename
As String) As XmlDocument
If HttpContext.Current.Cache(strcachename) Is Nothing Then
Dim xmldoc As New XmlDocument()
xmldoc.Load(HttpContext.Current.Server.MapPath(str xml))
HttpContext.Current.Cache.Insert(strcachename, xmldoc, New
CacheDependency(HttpContext.Current.Server.MapPath (strxml)))
'HttpContext.Current.Cache.Insert(strcachename, xmldoc)
End If
Return HttpContext.Current.Cache(strcachename)
End Function
Mar 13 '07 #1
0 835

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

Similar topics

1
by: Scott Lyon | last post by:
I'm maintaining (read: I didn't write it, nor do I have the time to spend to rewrite it) an application that is suddenly giving me grief. The reason I say suddenly, is because we're in the...
21
by: Jay Levitt | last post by:
I'm just starting to play around with CSS and MovableType. My home page (http://www.jay.fm) now validates on both the CSS and the XHTML. However, the Google cached version shows the wrong font in...
0
by: chewie | last post by:
Does anyone know how to clear IE cached credentials programmatically? I’m trying to clear IE cached credentials with a vb script or .exe. I’ve found a JavaScript function that does it on IE...
1
by: Martin | last post by:
I have a situation where I'm using XmlHttpRequests to update some data in a table every few seconds. The script that executes when the data comes into the browser checks to see if the data has...
5
by: wk | last post by:
hi, in my code document.all.value works but document.getElementById.value fails. any ideas why?
0
by: Timmay | last post by:
I'm looking for a way in vb.net 2005 to find the filename of the cached image for an image in the WebBrowser control. I can get the name of the image (ie: timmay.gif) with...
1
by: fred | last post by:
If configuration is cached, I can just use is the following code necessary ? this.lblMsg.Text = ConfigurationManager.AppSettings; If configuration is not cached by the framekwork, I should...
2
by: Simon Rigby | last post by:
Hi folks, ASP.NET2, Sql Server 2005 I have an app that executed a sql server query that produces an XML file used as the DateFile for an XMLDataSource bound to a TreeView. The bizarre thing...
10
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: ...
32
by: C. (http://symcbean.blogspot.com/) | last post by:
Hi all, I have an application which generates image graphs. These cache nicely at the client, however if the user submits more data, I'd like to force a reload of the image from the server. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.