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
[Enhancement]: Honoring MSSQL aditional properties on connection url #5728
Comments
@bsofiato thanks for raising the issue!
From the docs Your PR is welcome, just would like to take into account managing backward compatibility. |
@eddumelendez Great, I should submit a working PR for that in a couple of days |
Combined with microsoft/mssql-jdbc#1958, it makes it impossible to pass parameters any other way as even the following doesn't work: HikariDataSource(HikariConfig().apply {
jdbcUrl = "jdbc:tc:sqlserver:2019-latest:///"
driverClassName = ContainerDatabaseDriver::class.qualifiedName
dataSourceProperties = Properties().apply {
this["disableStatementPooling"] = "false"
this["statementPoolingCacheSize"] = "50"
this["sendStringParametersAsUnicode"] = "false"
this["enablePrepareOnFirstPreparedStatementCall"] = "true"
}
}) |
Module
MSSQLServer
Proposal
Unlike the other database modules, the MSSQL module does not honor additional properties passed on the connection URL.
The culprit seems to be the 'parseUrl' method on the ConnectionUrl class. It expects the query parameters to be prefixed by the '?' character. However, in the MSSQL case, those parameters are preceded by the ';' character instead.
This is particularly troublesome when you use hibernate and the char/varchar datatypes. By default, the MSSQL driver uses Unicode encoding. This triggers full scans when querying by columns whose type is char/varchar. Eventually leading to deadlocks (I have a hunch that this issue is related to this).
I propose that we change the ConnectionUrl class to allow it to parse MSSQL URLs correctly. If you guys deem this change worthwhile, I can submit a PR for it.
The text was updated successfully, but these errors were encountered: