-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Context:
As described here (#7444) it is possible to set a general query timeout for JdbcTemplate
. However, having in mind that JdbcTemplate
typically is a singleton bean, this is not sufficient when it comes to thread-per-request handling. Setting the queryTimeout state once would affect every subsequent query and interfere with parallel threads that use the JdbcTemplate
bean.
The use case is to easily set statement timeout individually and dynamically (e.g. because of expected query runtime that is affected by different statement params).
Proposal for new feature:
Overloading once more the execute()
, query()
, queryForX()
and update()
methods by adding a timeout parameter that then gets passed though the stack (i.a.applyStatementSettings()
) to finally call setQueryTimeout
on the Statement
.
Further References:
https://jira.spring.io/browse/DATAJDBC-638