Skip to content

java.sql.SQLTimeoutException not translated to org.springframework.dao.QueryTimeoutException [SPR-9376] #14012

@spring-projects-issues

Description

@spring-projects-issues

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:

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions