Replies: 3 comments 1 reply
-
possibly related: |
Beta Was this translation helpful? Give feedback.
0 replies
-
This may also be related: lurcher/unixODBC#149 |
Beta Was this translation helpful? Give feedback.
0 replies
-
FWIW, I am unable to reproduce your issue on Ubuntu 22.04 hitting an on-prem SQL Server 2019 instance.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please first make sure you have looked at:
Possibly related issue - Connection pooling issue Unix #774
Might also be related to changes introduced in Allow customization of default odbc version #1278
Environment
To diagnose, we usually need to know the following, including version numbers. On Windows, be
sure to specify 32-bit Python or 64-bit:
Issue
Often it is easiest to describe your issue as "expected behavior" and "observed behavior".
Helper code
Test function causing unexpected behaviour (explained below).
We are trying to create schema. In every scenario autocommit is True and Connection pooling is enabled.
The issue is when connection pool (global parameter) is enabled.
We are getting the following exception
ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]111212;Operation cannot be performed within a transaction. (111212) (SQLExecDirectW)')
Is this expected?
On first run, the function
poolTestWithAutoCommit()
creates the schema, no error.However, on subsequent run, we are getting
ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]111212;Operation cannot be performed within a transaction. (111212) (SQLExecDirectW)')
where as it is expected to show "There is already an object named 'test_scnema_001' in the database..."
Is connection pooling broken on latest versions of pyodbc?
Any recommended ways to use the pooling?
What is the role of this parameter "odbcversion" with connection pooling in place, do we need to set it explicitly on latest drivers? Looking for examples that simplify complexity involved with various global parameter (pooling, odbcversion and autocommit) combinations.
Beta Was this translation helpful? Give feedback.
All reactions