-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Sammy T Stag opened SPR-9376 and commented
java.sql.SQLTimeoutException is not translated to org.springframework.dao.QueryTimeoutException. I think line 74 of https://github.com/SpringSource/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java should be updated to fix this.
I have searched the 3.1.1 codebase and can find no reference to QueryTimeoutException anywhere except in that class itself.
The issue can be reproduced as follows if using an Oracle database
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.setQueryTimeout(1);
String sql = "call dbms_lock.sleep(10)";
jdbcTemplate.execute(sql);
The attached unit test reproduces the issue. I used the oracle ojdbc6 driver version 11.2.0.3 (http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html) and jdk7
Affects: 3.1.1
Attachments:
- test-data-source-context.xml (1.01 kB)
- TimeoutTest.java (1.19 kB)
Issue Links:
- Add QueryTimeoutException to the DataAccessException hierarchy [SPR-7680] #12336 Add QueryTimeoutException to the DataAccessException hierarchy
- SQLExceptionTranslators do not reliably translate QueryTimeoutException [SPR-11959] #16575 SQLExceptionTranslators do not reliably translate QueryTimeoutException