ColdFusion Troubles

I have been running awry of ColdFusion.

I am running Windows XP (not by choice), and had a local installation of ColdFusion 8 Server.  The instance of ColdFusion was stopped since it is a bit of a memory hog and I was not actively using it.  I have been working on getting an instance of Telligent Community Server up and running for evaluation purposes.  I was baffled by the fact that the Telligent demo was taking around 10 minutes on average to load a page from the local system.

Needless to say, since everything else seemed to be running fine, I was blaming Telligent’s software.  Then I started exploring a little more and figure out that IIS was taking around 30 seconds just to serve up an image.  Something was definitely up, but despite all of my best troubleshooting skills, I could not source the problem.

I did what I always do when something goes wrong that I don’t understand, I turned to Google.

I tried about 20 different “solutions” until I stumbled across a forum post saying to start ColdFusion if it was installed.  poof. The page that took 10 minutes to load before now takes 5 seconds.  It turns out that the CF ISAPI plugin is constantly trying to talk to the server.  If it can’t find the server, it doesn’t just die, it keeps trying. … on every. single. request.

strike one.

A short while later, I was working on trying to speed up a dashboard application that  coworker and I had written.  It is pretty simple. CF queries the database and retrieves somewhere in the range of 10-700 rows of data, turns them into objects, passes those objects off to Flex which then graphs the objects.  It was performing fine as long as there was less than 40 rows. By the time you got up to a few hundred rows of data, it would take an obscene amount of time to load.

We scratched our heads for the longest time and were pretty convinced that the Flex chart control was to blame.

Then we had an idea.  Instead of letting CF instantiate each row into an object, just send CF the results as an XML document from the database, let CF hand the XML off to Flex, and then proceed from there.

Same story. 10 minutes now became 2 seconds.

It seems that ColdFusion doesn’t do so well at creating objects.

strike two.

I’m not very pleased with ColdFusion at the moment.

Response.Redirect inside of a Try/Catch

Ok, first off, let me state, that I am not entirely certain WHY I did this in the first place.  I am going to say I was rushed and wasn’t thinking clearly.  However, I glazed over it and moved on and when it came time to test, I was getting bizarre behavior that didn’t throw an error.

Session[“var”] = “”; 
try { 
    Session[“var”] = “Good Value”; 
    Response.Redirect(“newpage.html”); 
} 
catch(Exception ex) 
{ 
    Session[“var”] = “Bad Value”; 
}

In the code above, Session[“var”] will ALWAYS equal “Bad Value”.  Why you may ask?

Response.Redirect throws a ThreadAbortException.  … Fun, no?

If you are building a URL inside of a try block that you want to then redirect to, declare a string, build your url, and then pass that on to the Response.Redirect statement.

For Example:

string _url; 
try {
    _url = “yourpage.aspx?var=” + iffyMethodCall(); 
} 
catch(InvalidOperationException ex) 
{
    _url = “error.html”; 
} 
Response.Redirect(url);

So, If you ever run into odd behavior in a site you are working on and when debugging, your code goes straight past your Response.Redirect and into the catch block and the debugger starts giving you cryptic messages, this may be what you’re seeing.

IIS Worker Process fail 503 Error

Helping a friend to configure his new Win2k8 Server with IIS7 this weekend we ran into an issue where IIS kept returning 503 errors.
Examining the Application Event log I saw that  IISW3SVC-WP was quitting due to application errors. “The error is the data”.  How helpful.
After a considerable amount of digging I discovered that in the Microsoft.Net/Framework/ folder, there was a beta version of v2 of the framework.  The only version that should be there is v2.0.50727.
I deleted the beta version of the framework and restarted the IIS worker processes that were causing problems and everything immediately burst to life!
I’ve no clue what installed the beta version of the framework, but it is a definite lesson to make sure that when distributing a framework to be 100% certain that you are always including the latest “release” version… oh yeah, and perhaps doing a check for an existing version of said framework before installing.
At any rate, hope this helps somebody.

Useless entry #268

While in a chat today, the following conversation occurred…

After I stopped laughing I had to post it.

A : I had a mouse in my well the other day. I shop-vac-d it out.

B : lol, I can hear it now… “whrrrrrrrrr, ssshhTHUNK”

C : phoomp

D : and forever after the other mice tell tales of abduction from above

D : “seriously, it was like some kind of tractor beam!”

B : But is derided as a crazy mouse.

Whedon Quote

I am not sure how many of you are Whedon fans like myself.  I came across this today and I’m posting it in part because it is, in my opinion, phenomenal, and also so that I have an easy place to look it up in the future.

Passion, it lies in all of us, sleeping… waiting… and though unwanted… unbidden… it will stir… open its jaws and howl. It speaks to us… guides us… passion rules us all, and we obey. What other choice do we have? Passion is the source of our finest moments. The joy of love… the clarity of hatred… and the ecstasy of grief. It hurts sometimes more than we can bear. If we could live without passion maybe we’d know some kind of peace… but we would be hollow… Empty rooms shuttered and dank. Without passion we’d be truly dead.

– Joss Whedon