27. Juli 2010

Update 1 (July 29th 2010): Adobe has officially accepted this as a bug and targets a fix for 9.0.1 (Hotfix). 

ColdFusion 9.0.1 is essentially disqualified to be used with NoSQL datastores where JSON is involved.

We have used ColdFusion since 3.0 in 1998 upgrading to 4.0, 5.0, 6.1, 7.0, 8.0 and 9.0.
We did this upgrade for our servers and for even more of our customers servers that use our software.

So i am kind of an ColdFusion evangelist with one difference being that i don’t get paid by Adobe but i pay them, even though i sell their products to our customers.
Another difference is that i don’t greet every change or feature a new version brings with cheer no matter how badly implemented it is. And i don’t try to sell bugs as features. Because in the end bugs cost our customers more money because we have to waste time to work around them. Or in the worst case use other technology to get around those bugs.

I hope fellow ColdFusion developers agree with me on this. We like to use ColdFusion. We get work done with it. We get it done fast on a reliable platform. After all, if i would not like ColdFusion i would not write the following.

The SerializeJSON() function was flawed in 8.0 and 9.0 and is now broken in 9.0.1.
And Adobe needs to fix it asap before more people upgrade to 9.0.1

17. Dezember 2009

Just a quick one. I wrote this generic function today to convert any query to a valid JSON string with lowercase element names.

 

<cffunction name="queryToJSON" returntype="string" access="public" output="yes">
<cfargument name="q" type="query" required="yes" />
<cfset var o=ArrayNew(1)>
<cfset var i=0>
<cfset var r=0>
<cfloop query="Arguments.q">
<cfset r=Currentrow>
<cfloop index="i" list="#LCase(Arguments.q.columnList)#">
<cfset o[r][i]=Evaluate(i)>
</cfloop>    
</cfloop>
<cfreturn SerializeJSON(o)>
</cffunction>

 

Just call this function with:


<cfset myJSON=queryToJSON(yourQueryName)>

06. November 2009

While playing around with CouchDB, ColdFusion and SerializeJSON i found that the SerializeJSON does not honor the SetLocale setting. It will use the "Java Default Locale" which is set for the JRE.

So if your Windows installation is German, you will have a DE_de locale.

Now if you us SerializeJSON for a date you will get a date like "März, 21. 2009". Not really good to use this in another DB.