March 12, 2008 at 9:29 am
Hi
I am having a randomly recurring problem where I get the error message:
"Could not find prepared statement with handle xx"
where xx is a number.
The problem occurs randomly and can be solved just by forcing a dummy change in my SQL (such as a new line break) and re-running it, with no SQL changes.
Does anyone have any ideas on what could cause this?
Thanks!
March 13, 2008 at 9:18 am
Is it the full error message?
Do you use JAVA?
Does your server have a limit in concurrent users?
The following link may help a little bit.
March 14, 2008 at 8:32 am
It a Java app, although that is hidden from my interface, where I am writing just the SQL and submitting it. The full message I get is:
sql: java.sql.SQLException: Could not find prepared statement with handle 1.
...but I don't get the java stack dump (maybe its hidden from my application).
Not sure about the concurrent server user limit - it should be high.
What is actually happening on SQL Server when I use (or at least the Java ODBC driver uses) prepared statements?
I would guess that on first execution, the statement is prepared and executed. On subsequent executions, a handle is used to point to the prepared statement, and therefore only the execution actually takes place (instead of prepare & execute). Could anybody confirm that is how it should work?
Thanks!
March 14, 2008 at 9:05 am
You can cooperate with your DBA to check the version of your SQL Server, and its setting of max connections.
March 14, 2008 at 10:21 am
We have SQL Server 2000 and maxActive is set to 20 for our connection.
November 30, 2009 at 9:00 am
Check out microsoft ADO.NET 2.0 hotfix in this link, it appears to be related to your problem:
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply