I ran into a very odd issue this week with Coldfusion 7. I have an application that I have had up and running for a couple years and I made some database changes, CFquery (DAO) changes. Since I use Illudium-PU 37 Generator for most of my Bean, DAO, Gateway, & services I automatically get the benefit of being reminded about cfqueryparam (Thanks Brian). Unfortunately this time around I didnt regen the files, I simply went in and made a couple modifications since I only added like two columns to the table.
Well all went well for like a week, than all of a sudden I started getting this crazy error. I kept getting a message saying "Invalid Parameter Binding(s)" and it wasnt even the new columns I just added, it was something else entirely.
I did some digging in my cfdump of the cfcatch error message, I discovered that for some odd reason Coldfusion was converting a bit into a integer even though both my bean, ActionScript Value Object and the cfqueryparam were all set to a boolean value / cf_sql_bit. So when flex sent over the data to CF all was well, but when it sent the data to the DAO.cfc to do a save/update into the database the cfqueryparam was sometimes doing it right and sometimes doing it wrong, it was really -- really hard to duplicate the error message, but here is what it the message was returning in the cfcatch: (I am providing a very small snippet)
(param 12) = [type='IN', class='java.lang.Boolean', value='true', sqltype='cf_sql_bit'] ...so far so good...blah blah.... (param 37) = [type='IN', class='java.lang.Integer', value='0', sqltype='cf_sql_bit'] , (param 38) = [type='IN', class='java.lang.Integer', value='0', sqltype='cf_sql_bit']You can see how at first the class was java.lang.Boolean, value was true and sqltype was cf_sql_bit, but later the java class type changes to java.lang.Integer, value to 0 and sqltype is still cf_sql_bit. The code never changes the item to a 0 or a 1 and my bean is a Boolean datatype, not a integer. I am still a little puzzled as to why this happened, it rarely occurs therefore its nearly impossible to duplicate on my own.
Ray Camden blogged about something similiar happening to him late last year and it turned up to be a caching issue when dealing with cfqueryparams in a query that is cached either in the app scope (in my case it was Coldspring, which is cached in the app scope).
Anyway, odd as hell figured I would put this out there wondering if anyone knows a fix besides putting some spaces in the queries and restarting CF. Again I have no idea if that fixed my issue or not, I wont find out until I get another mysterious error message or a phone call from a frustrated user.
#1 by ike - September 16, 2008 at 11:17 PM
#2 by Nancie - September 17, 2008 at 5:20 AM
#3 by Joshua - September 17, 2008 at 6:31 AM
#4 by Kevin - September 17, 2008 at 6:59 AM
#5 by Britannia - August 27, 2009 at 2:42 PM
#6 by Jenny Gavin-Wear - May 22, 2011 at 4:43 PM