Re: How to fix error "Connection is busy with results for another hstmt"
- From: John Elliot <johne@xxxxxxxxxxxxx>
- Date: Thu, 25 Jun 2009 14:25:24 -0400
Vijay,
MS SQL Server, by default, only supports one Statement object per connection. This means that only one of your threads can submit a request.
Possible solutions are:
1. Create a server side cursor. This is typically done by putting "SelectMethod=cursor" in the connection string. When you define a server side cursor, SQL server will allow multiple statements per connection;
2. This is a better option. Create a connection pool in your application. When a thread needs a connection, it should get it from the pool and return it back when done.
If possible, avoid using SQL Server cursors. They generally use a lot of SQL Server resources and reduce the performance and scalability of your applications. If you need to perform row-by-row operations, try to find another method to perform the task.
Regards,
JE.
vijay singh wrote:
Platform: VS 2008, SQL Server 2005, OleDB.
Hi,
I am using OleDB connection in vc++ code to insert data in sql server database. Single connection is being used by multiple threads to insert data. Sometime program is reporting error "Connection is busy with results for another hstmt".
Please help me how this issue can be resolved.
Thanks in advance,
Vijay
- References:
- How to fix error "Connection is busy with results for another hstmt"
- From: vijay singh
- How to fix error "Connection is busy with results for another hstmt"
- Prev by Date: xml Export
- Next by Date: Cannot load the DLL xpstar.dll,
- Previous by thread: How to fix error "Connection is busy with results for another hstmt"
- Next by thread: xml Export
- Index(es):
Relevant Pages
|