Skip to content

JdbcTemplate does not call handleWarnings in case of exception #23106

@jMediaConverter

Description

@jMediaConverter

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.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions