You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mssql+aioodbc (pyodbc.Error) ('HY000', "[HY000] [Microsoft][ODBC Driver 17 for SQL Server]La connexion est occupée avec les résultats d'une autre commande (0) (SQLExecDirectW)")
#462
Open
Flofinal opened this issue
Nov 20, 2024
· 1 comment
Hello, sometimes when I call an API function I get this exception error : (pyodbc.Error) ('HY000', "[HY000] [Microsoft][ODBC Driver 17 for SQL Server]La connexion est occupée avec les résultats d'une autre commande (0) (SQLExecDirectW)")
The bug probably comes from a cursor not closing properly in aioodbc and sql server.
I switched to pyodbc with the sync engine and there are no more problems. So I think the problem is with aioodbc with sql server.
We recently converted our app to use async database calls, and newly introduced aioodbc and we are also having this issue. We were not having this issue with just pyodbc before. We have been able to get around the issue by enabling MARS (Mars_Connection=yes in the connection string), but that seems more like a band-aid than a solution as we are not intentionally executing multiple queries on the same cursor.
Environnement:
Hello, sometimes when I call an API function I get this exception error : (pyodbc.Error) ('HY000', "[HY000] [Microsoft][ODBC Driver 17 for SQL Server]La connexion est occupée avec les résultats d'une autre commande (0) (SQLExecDirectW)")
The bug probably comes from a cursor not closing properly in aioodbc and sql server.
I switched to pyodbc with the sync engine and there are no more problems. So I think the problem is with aioodbc with sql server.
Function api exemple (not the real code):
Usually the bug happens on the line await session.commit() or await session.delete(doublet) or await session.delete(doublet)
Thanks!
The text was updated successfully, but these errors were encountered: