We periodically get the following error, but often:
Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Could not find prepared statement with handle 1.
I implemented two solutions to this problem that I could find -
- Put a semicolon at the end of the query (supposedly to force recompile the query)
- Put this MS-SQL at the end of the query:
OPTION (RECOMPILE)
I applied fix 1 and the errors were stopped for the rest of this day. The next day, the error returned.
I applied Patch 2, and the same thing happened - more errors until the next day.
I understand that whenever I use <cfqueryparam> , the prepared statement is used automatically, but there is no way to get db to "rework" every time a query is used, rather than relying on cached expressions?
Please note that I do not have administrator access to this Cf server.
Cf Version - 9.0.0
SQL Server 9.0.3054.
Offensive request:
<cfquery datasource="#dsn#" name="q" maxrows="1"> SELECT ID FROM tableOne WHERE ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#url.ID#"> ORDER BY ID </cfquery>
thanks
source share