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
JdbcTemplate
does not call handleWarnings
in case of exception
#23106
Comments
I think that might be enough move the call to handleWarnings inside finally instead that in the try. or double it inside the catch |
That's right. |
There are only really two modes of operation for |
Let me explain my exact use case. I am calling a stored procedure using |
JdbcTemplate
does not call handleWarnings
in case of exception
It looks like we can add the |
Sounds like a good plan. Thanks. |
Thanks for quick turnaround! Rolling this into 6.0.11 and backporting it to 5.3.29, both to be released on Thursday. |
Affects: 4.2.4
The JdbcTemplate class allows statement warnings to be processed, see the JdbcTemplate# handleWarnings(Statement) method. However, the warnings are only processed on successful execution of the statement, though warnings may be generated even if the statement fails.
See the methods:
execute(StatementCallback)
execute(PreparedStatementCreator , PreparedStatementCallback)
execute(CallableStatementCreator , CallableStatementCallback )
All these should probably call handleWarnings in their catch block before closing the statement.
The text was updated successfully, but these errors were encountered: