Skip to content

Commit 62b56f3

Browse files
committed
2nd commit for http://code.google.com/p/mybatis/issues/detail?id=237 . close connections for any exception, not just SQLException
1 parent 8b217af commit 62b56f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private SqlSession openSessionFromDataSource(ExecutorType execType, TransactionI
7878
Transaction tx = transactionFactory.newTransaction(connection, autoCommit);
7979
Executor executor = configuration.newExecutor(tx, execType);
8080
return new DefaultSqlSession(configuration, executor, autoCommit);
81-
} catch (SQLException e) {
81+
} catch (Exception e) {
8282
closeConnection(connection);
8383
throw ExceptionFactory.wrapException("Error opening session. Cause: " + e, e);
8484
} finally {

0 commit comments

Comments
 (0)