After changing the structure of a table in the database, I'll sometimes get the following error:
[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.
Or, I'll add a field to the table, but ColdFusion won't recognize the change.
After googling, I found this post: Odd Issue w/ CFQueryParam from Ray Camden, which puts to rest a lot of the mysterious behavior of ColdFusion query caching that has been haunting me for so long. Turns out it's triggerred by the presence of the CFQUERYPARAM tag. Here's the solution I found (thanks Eric!):
The solution: due to caching of the odbc driver, you do NOT have to restart CF.
1. Go in the settings of the current datasource an UNCHECK 'Maintain Connections' --> submit the change
2. Rerun the page with the changed view/table/sp and make sure it's running fine.
3. Go back into the odbc settings an re-enable the 'Maintain Connections' --> submit the change
4. done!
Now everything should be working fine without restarting CF where a lot more i cached, like templates etc.
To get to the Maintain Connections option, I had to click on 'Advanced Settings' in the datasource properties in CFAdmin.
I can finally stop adding random spaces or tabs in my queries to stop ColdFusion from using the cached copy!



1 comments:
THANK YOU!!!
I have been trying to figure out what the hell was wrong with my code until I found your post...
Post a Comment