-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Error with SQL Type with a null parameter in MS SQL Server spring-jdbc > 6.1.2 #33418
Comments
Looks like a side effect of #25679 indeed. For the time being, please keep setting For the record, we also had another regression on MS SQL Server caused by this optimization: spring-projects/spring-data-relational#1827 - so we might have to revisit our default there. |
i've downgraded the spring-jdbc dependency to 6.1.1 as there is only patch version differences, it works as expected with my spring boot versions. |
I recommend the Note that there may be a performance impact on MS SQL Server which is why we changed the default of that property in 6.1.2 to begin with: #25679 (comment) - If in doubt, we'll nevertheless have to accept that performance overhead in order to provide correct behavior for scenarios like yours. |
According to microsoft/mssql-jdbc#1269 (comment), this issue just appears for varbinary, binary and image columns on SQL Server. For all other column types, So we currently avoid the performance overhead of The safest solution is to pass your |
Affects: \ spring-jdbc 6.1.2 and up
Hi,
I have an issue with a spring boot application that uses spring-jdbc 6.1.11,
i have an error after version upgrade that tells me (in french)
the english equivalent is something like :
when doing a simple sql update request with a null parameter such as
where the parameter value for name is null.
in my code the column that we try to set to null is a varbinary, but i've also tried to set a varchar to null, the same issue happens.
tested with multiple mssql-jdbc driver version the errors still occurs (even with the version provided by the spring boot parent pom)
tested by only changing spring-jdbc version worked in
6.1.0, 6.1.1, 6.0.23
but didn't work from 6.1.2 to 6.1.12
it seems from decompiling that the issue happens when the boolean
useSetObject
is set to true at line 272 and 297 in the filespring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
i've tried debugging, when forcing this value to false, the sql requests works,
when setting the property shouldIgnoreGetParameterType to false (by the spring property
IGNORE_GETPARAMETERTYPE_PROPERTY_NAME
) it also worksthe SQL Server version used is :
Microsoft SQL Server 2019 (KB5039747) - 15.0.4385.2 (X64)
my pom :
The text was updated successfully, but these errors were encountered: