From 0c6b38b0b5749057d6e9dcb5f7917f27e6542fc3 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 25 May 2010 14:10:28 +0000 Subject: [PATCH] DataSourceUtils lets timeout exceptions through even for setReadOnly calls (revised; SPR-7226) --- .../jdbc/datasource/DataSourceTransactionManagerTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.springframework.jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java b/org.springframework.jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java index 07c6efaf349..89ecf0bc66e 100644 --- a/org.springframework.jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java +++ b/org.springframework.jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Savepoint; - import javax.sql.DataSource; import junit.framework.TestCase; @@ -463,6 +462,8 @@ public class DataSourceTransactionManagerTests extends TestCase { conControl.setReturnValue(false, 1); con.rollback(); conControl.setVoidCallable(1); + con.setReadOnly(true); + conControl.setThrowable(new SQLException("read-only not supported"), 1); con.isReadOnly(); conControl.setReturnValue(false, 1); con.close();