Jul 25 2006

ColdFusion MX vs. Microsoft’s XML API

Published by Mike Munhall at 2:26 pm under ColdFusion, Web Development

In our ongoing quest to finish the ColdFusion 4.5 to MX 7.01 upgrade, we ran into another snag that had our heads spinning for a while. As we were migrating servers from 4.5 to 7.01, we were getting more and more frequent “unable to create new native thread” errors and complaints from customers about servers being unavailable or just general latency.

During this time, we also had reports of two particular pieces of functionality that were not working at all. The two pieces of functionality that were not working had one thing in common: they were both instantiating objects from the MSXML API. We were using Microsoft’s XML API in ColdFusion 4.5 because 4.5 obviously doesn’t have an XML API of it’s own.

Well, as it turns out, the MSXML API was reaking havoc on the system. Essentially, if MX attempted to instantiate an object from the MSXML API, all operating system threads would immediately get eaten up and the MX server would just hang or die. What’s worse is that a restart of the CF services would not alleviate the problem. The OS threads would remain unavailable until the entire machine was restarted.

We didn’t bother trying to find out why CF wasn’t playing well with the MSXML API. The solution, as you would guess, was simple. We just had to rewrite the XML routines using the native ColdFusion MX tags and functions. We were using the TorchXML 3rd-party XML parser (which leverages the MSXML API) to parse XML documents. The TorchXML API is similar to the ColdFusion XML tags and functions in the fact that you work with a complex structure to access and work with the data in the XML. We simply had to replace a few strings in each implementation of the parser to get it working in MX:

Replace TorchXML with CF Equivalent
attributes XmlAttributes
value XmlText
nodeName XmlName
childNodes XmlChildren

One Response to “ColdFusion MX vs. Microsoft’s XML API”

  1. markoon 26 Sep 2006 at 4:58 pm

    hey mike -
    great CF stuff, by the way. i’m jammed up with a mx6.1 issue and i’m wondering if you can help. i’ve just migrated an app to my own dedicated server (Win2003, IIS6.0, MX6.1) and now the instances of CFMAIL that include attachments don’t work. no errors in the logs - they just vanish and never get delivered anywhere. this looked similar to one of your posts so i’m wondering if you have any advice. thanks!

Trackback URI | Comments RSS

Leave a Reply