Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > XML cached document fails intermittantly

Reply
Thread Tools

XML cached document fails intermittantly

 
 
Chris
Guest
Posts: n/a
 
      03-13-2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Acer Aspire Iv5 - Keyboard goes dead intermittantly tonyspringer General Computer Support 0 01-30-2013 06:56 PM
SPA3102: Intermittantly Needs Reboot? (PeteCresswell) UK VOIP 12 09-17-2012 09:07 AM
Win98 box intermittantly getting 'No permission to access resource' error Remmy Computer Support 14 11-08-2005 08:56 AM
my cached dataset just wont stay cached!! Craig G ASP .Net 0 03-07-2005 10:02 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57