Multi-Server Transactions with CFThread

Braided ThreadsI ran into an interesting problem today: I have an application where I need to add a user record to one server, and also conditionally add some records to another server for that user. Problem is that this needs to be inside a transaction, and ColdFusion doesn't allow multiple server connections inside a transaction, even if they are on the same datasource. To get around this, I employeed <cfthread/>. Click "read more" to ready how.

 

ColdFusion and IIS Failing to Find Files

A stink bug I ran into an interesting issue with a site that my company hosts this week, and I thought I'd share the problem description and solution. A number of files and images started to fail to return, saying that either they could not be found or that the user was not allowed to view the file. Those ColdFusion pages that did return would say that they couldn't find the specified files either.

 

CFGrid Displays No Data Until Sort

So, another annoying bug, but at least I found a solution this one. I'm using Prototype and trying to get CFGrid running. Things went OK except that when I made a grid, it would load looking like the example to the left; no data listed. If you clicked on the "Students" header, you'd get the full list of students like the example on the right.

I was finally able to find an article in the House of Fusion mail archive that described no only the problem, but a solution:

Solution! After tearing the Javascript apart for both libraries, I found the problem. Both libraries use a function called "defer", which basically just delays performing that action until the interpreter's callstack is empty. My solution then was to change the name of this function in Prototype and then just change the name wherever Prototype references it also. None of the Prototype plugins I have use the function, so it's seems like it's pretty low-key.

So I quickly did a find and replace and changed Prototype's "defer" to "pdefer" and things started up fine.

 

FCKEditor + Session Values = Big Question Mark

So I ran into an interesting issue when dealing with session values in FCKEditor. As per a recent post, I've got a modified version of FCKEditor 2.6.4 setup to use dynamic user folders (one per site, with multiple sites in the system), and things were going pretty well. Unfortunately, I'm running into an interesting issue getting my session values to exist when I need them. What ends up happening is that the first time a use loads the editor, if they attempt to use the file browser, the session data is invisible to the config file. I've captured a screen shot of test of this issue:

Image of Missing Session Values

As you can see, despite being a later time stamp, the second browser window does not have the correct session values. I've verified that there are no additional application files between the test.cfm page and the viewpage.cfm that is pictured.

Now here is the interesting bit... if you refresh the page, the session information suddenly begins displaying on the test page:

Image of Session Values Displaying

Ok, so I'm running in a clustered environment, so maybe there is a value propagation problem where its taking some time to get the values to the second instance... except no matter how long you sit and refresh the test page, the values never show up until you refresh the view page. This means that the values aren't even displaying if you're hitting the same instance as the one on which they were set.

I simply don't have an idea what is going on here. I could maybe understand if it was a cookie bug since this is in different window, but the site is clearly figuring out that its the right session, its just not getting the session information for those values.

Am I missing something?

Update Thanks to J Cyr for point out that I missed blurring out one of the urls... definitely a boo boo on my part.

Also thank you for the idea about domains, but if you look close enough, the session IDs match, and the user object is present in both windows. Its just that not all of the information transfers.

 

Custom Upload Paths in FCKEditor with ColdFusion

For some of my more recent projects I've needed to integrate FCKEditor into the system, and while FCKEditor is great, it lacks the ability to easily specify a custom upload path, other then through the configuration files. I didn't find a way around that, but I did find a way to to get FCKEditor to support multiple, dynamic file locations. Click More read on.

 

ColdFusion Instance Issue

ColdFusion Logo I'm running into a weird issue this morning at work. We have two servers behind a load balancer, and on those servers we have two ColdFusion instances clustered together (one on each, call them Thing1 and Thing2) both the hardware load balancer and the CF cluster are setup to round robin the requests. Every 20 minutes or so all you can get from one of the sites is 503 error pages. When looking into it, you can get to the ColdFusion Admin for the main instance on each server, and to Thing1's admin, but not to Thing2's CF Admin (throws 503s as well). From Thing2's main instance admin, you can go in and stop the instance, and immediately the 503 errors disappear. However, after about 5 second, Thing2 starts itself up again automatically, and 20 minutes or so later, things grind to a halt again.

I'm checking into the ColdFusion and JRUN logs now to see if I can find anything as to why this might be happening, and will update as I go. Click "More" to read about my ongoing battle.

 

More Entries

Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.