Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug #450: Re-enable using connection pooling by default for SQL server#451

Merged
erikbra merged 1 commit intomainfrom
chore/enable-sqlserver-pooling-again
Feb 25, 2024
Merged

Bug #450: Re-enable using connection pooling by default for SQL server#451
erikbra merged 1 commit intomainfrom
chore/enable-sqlserver-pooling-again

Conversation

@erikbra
Copy link
Collaborator

@erikbra erikbra commented Feb 25, 2024

When solving #232 , the solution was to disable connection pooling by default it not explicitly set to "true" in the SQL server connection string. This did solve the problem, but setting "Pooling=true" in the connection string is rather unusual with SQL Server, as this is the default.

Disabling pooling severely affects performance negatively, especially on authentication types that takes a while to establish, e.g. Azure AD authentication. When the pooling is disabled, the connection is actually closed every time we close it, instead of being returned to the connection pool, ready to be re-used without authenticating again (and taking the performance hit).

This PR removes explicitly turning off connection pooling if not explicitly set to true in the connection string. Running the runAfterCreateDatabase scripts in an autonomous transaction should be a better workaround for the issue in question, and avoids the performance hit for the common usage scenarios

@erikbra erikbra marked this pull request as ready for review February 25, 2024 14:33
@erikbra erikbra merged commit e4370c7 into main Feb 25, 2024
@erikbra erikbra added this to the 1.6.2 milestone Feb 25, 2024
@erikbra
Copy link
Collaborator Author

erikbra commented Feb 25, 2024

FYI, @wokket - please scream out if 1.6.2 introduces any issues for your use case (when it comes out) - or, even better, if you have the chance to run against a locally built version from source (latest main) and confirm that it does indeed work for you if you change the transaction handling of the RunAfterCreateDatabase to Autonomous.

@erikbra erikbra deleted the chore/enable-sqlserver-pooling-again branch February 25, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant