This is driving me bonkers and I cannot for the life of me figure out what is going on. Ok, quick background: I am working on an application that uses an APPLICATION-cached query titled "NoteTable". This just has some data fields to hold some simple message data. Everything goes fine until the data types of the ColdFusion query randomly change! This is totally screwing me over as I use the query Meta Data (new to CFMX 7) to convert the query to XML and back to a query.
After some debugging, I have narrowed it down to this chunk of code:
<cfmail to="firstname.lastname@example.org" from="email@example.com" subject="BEFORE - #REQUEST.Attributes.action#" type="HTML"> <cfdump var="#GetMetaData( APPLICATION.NoteTable )#" /> </cfmail> <!--- Store the results query directly into the result object. ---> <cfquery name="REQUEST.Response.Data" dbtype="query"> SELECT id, page_key, description, name, email, date_posted, date_completed, parent_id FROM APPLICATION.NoteTable WHERE id = <cfqueryparam value="#REQUEST.Attributes.id#" cfsqltype="CF_SQL_VARCHAR" /> </cfquery> <cfmail to="firstname.lastname@example.org" from="email@example.com" subject="AFTER - #REQUEST.Attributes.action#" type="HTML"> <cfdump var="#GetMetaData( APPLICATION.NoteTable )#" /> </cfmail>
As you can see from the above code, I am CFMailing myself the query meta data of the APPLICATION.NoteTable query. Then I perform a ColdFusion query of queries on the table. Then I CFMail myself the meta data once more. Notice that I am at NO point updating the APPLICATION.NoteTable query in any way. I am just querying off of it.
Here are the two dumps I get in the mail:
... and then the one after:
Suddenly, the data types changes. I am pulling my hair out over this. I am the only one using this system right now. I know that it is not some crazy thread situation where a different call is changing the database at the exactly same time this is going on. NOT possible.
What is the ColdFusion query of queries doing here? Someone please help me to understand!
Want to use code from this post? Check out the license.