Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection is busy with results for another command (0) (SQLExecDirectW) #1333

Closed
soujanyat opened this issue Mar 18, 2024 · 3 comments
Closed

Comments

@soujanyat
Copy link

soujanyat commented Mar 18, 2024

Please first make sure you have looked at:

Environment

  • Python: 3.10.9
  • pyodbc: 4.0.35
  • OS: Ubuntu 20.04
  • DB: MSSQL
  • driver: ODBC Driver 17 for SQL Server

Issue

sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('HY000', '[HY000] [Microsoft][ODBC Driver 17 for SQL Server]Connection is busy with results for another command (0) (SQLExecDirectW)'

SQLAlchemy - 1.4.52
zope.sqlalchemy - 3.1
z3c.sqlalchemy = 2.1.1
No of Threads = 4

We are working on SQLAlchemy version up gradation project from version 1.3.x to 1.4.52 on ZOPE Framework. Post upgrade started getting Connection busy error and unable to access the application. We need your help to understand the issue and solution.

Thank You,

@v-chojas
Copy link
Contributor

Try adding MARS_Connection=Yes to your connection string.

@soujanyat
Copy link
Author

Try adding MARS_Connection=Yes to your connection string.

Thank you @v-chojas
yes, we have tested with MARS_Connection=Yes connection string. Connection busy error is resolved however faced application slowness more than thrice the execution time of each APIs.

Is there a way to handle it without MARS_Connection or handle slowness

@v-chojas
Copy link
Contributor

It sounds like your application is attempting to use multiple active resultsets, so you'll need to figure out how to change it to not do that. Unless MARS is enabled, the driver can only process one query at a time on a connection.

Repository owner locked and limited conversation to collaborators Mar 19, 2024
@gordthompson gordthompson converted this issue into discussion #1334 Mar 19, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants