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
The driver doens't honor default properties #1958
Comments
Hi @mmimica, Thank you for identifying an issue and creating a PR. Because of the extensive testing required, this issue and its PR will be backlogged for at least the next little while. We'll take a look at it again as soon as we can. |
hi @mmimica just to clarify, the 1st part of your example does work we do use that in our junit tests eg here. The 2nd part of your repro is not currently supported and would require quite a bit of testing effort to ensure it works with all existing properties. We have to triage and prioritize all issues and enhancement requests for the driver so given that there are other supported ways to set properties for the driver this enhancement will likely not be treated as very high priority. So in the mean time, please use other supported ways to set the properties for the driver. |
In the real world out there, a developer seldomly has a chance to interact with a JDBC driver directly. Usually the driver gets its
I understand the change may impact existing working environments. I already have a workaround for my case. I mainly created this ticket for visibility. It's up to you what you are going to do with with the PR. |
In revision 12.2.0 of SQLServerDriver.java the method named fixupProperties does not account for props.defaults. This results in loss of client requested parameters that were relegated to the defaults member as @mmimica mentioned in a previous comment. I am working around the issue by including the JDBC connection properties in the connection URL (as opposed to a separate Properties parameter of the connect method. |
Driver version
11.2.1 but probably goes way back.
Problem description
java.util.Properties
has notion of "default" properties, as a way to inherit properties. This mechanism is used by testcontainers framework. The driver looks only for top-level properties.Expected behavior
The above should print
true
, as the passedprops.getProperty("enablePrepareOnFirstPreparedStatementCall")
evaluates to "true".Actual behavior
It prints
false
, ignoring the property passed to the driver.The text was updated successfully, but these errors were encountered: