Groups | Blog | Home
all groups > sql server odbc > august 2004 >

sql server odbc : Connection is busy with results for another hstmt



Athar
8/6/2004 11:05:17 AM
I have my java based application that works fine with SQL
server 6.5.

I upgraded DB to SQL Server 2000 and now the application
give me "Connection is busy with results for another
hstmt " ODBC error after I do couple of queries or updates
through the application.

Is it anything to do with ODBC drivers or I have to change
setup of SQL Server?

Thank you
Brannon Jones
8/17/2004 2:42:11 PM
SQL Server only supports a single active statement per connection. Are you
using the MS JDBC driver to access SQL Server?

If you aren't actually trying to use multiple statements per connection,
then you might be able to workaround the error by making sure the statement
is closed before using another one. I'm not familiar with the JDBC
interface, but in ODBC, you'd call SQLMoreResults() until it returned
SQL_NO_DATA to make sure you've processed all of the results on the wire.
In ADO.NET you will get the same error if you haven't called Close() or
Dispose() on the SqlDataReader before trying to Execute another SqlCommand
on the same SqlConnection.

If you are trying to use multiple statements per connection (at the same
time), then you need to use multiple connections instead.

SQL Server 2005 has a new feature called MARS (Multiple Active Result Sets)
which will allow multiple statements per connection.

Brannon

[quoted text, click to view]
AddThis Social Bookmark Button