ColdFusion Updates Released Today

This post is more than 2 years old.

As the title says, multiple updates were released for ColdFusion today. One is an update to ColdFusion 10 (details may be found here) and the other is a rather big update to ColdFusion 11, Update 5.

You can see the complete list of bug fixes here: Bugs fixed in ColdFusion 11 Update 5. I want to call out one bug in particular that I'm happy is fixed: 3818767: Serialization of query does not respect case.

ColdFusion 11 added a new way to serialize queries - "struct". You could pass this to the serializeJSON function or simply specify it as a default in Application.cfc. I discussed this in detail here: ColdFusion 11’s new Struct format for JSON (and how to use it in ColdFusion 10). While this was cool, the columns were all uppercased when the JSON string was generated. So for example:


While still a better format, most people prefer lowercase. Now ColdFusion let's you specify a setting to tell ColdFusion to use the same case you used in the query. To enable this feature, add this.serialization.preserveCaseForQueryColumn="true" to your Application.cfc file. Here is a complete example.

component {"root";

Now your query will serialize and respect the case you used when writing your SQL.

Adobe forgot to update the docs for this, but luckily I still have edit access to the wiki. You can see this, and the other Application.cfc variables, here at the reference: Application variables

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

Archived Comments

Comment 1 by James posted on 11/23/2020 at 2:28 PM

Hi Raymond

I've been struggling with this for a while.

I've added:

<cfset this.serialization.preservecaseforstructkey="true">
<cfset this.serialization.serializequeryas="struct">
<cfset this.serialization.preservecaseforquerycolumn="true">

But my JSON still returns in uppercase.

Here is my query:

<cfquery name="somequery" datasource="#application.db#">
select zone_country_ID, country_name
From tblCountries
order by zone_country_ID

Here is my data:

<cfset reslistcountryinfo["data"]="somequery">

zone_country_ID, country_name are both being returned in UPPERCASE? In the DB they are stored as displayed here.

Do you have any advice for me?

Comment 2 (In reply to #1) by Raymond Camden posted on 11/23/2020 at 3:19 PM

Well first off, I assume your last line didn't mean to use quotes around somequery, otherwise you would return the exact string.

Outside of that, I've seen CF cache application settings. If you can restart CF, try that, _and_, edit a file. Any file. Like add a new line. Restart CF and see if that helps. In a pinch, rename the name of the application.