Resource-based PlatformTransactionManager implementations defensively catch Throwable in doBegin in order to reliably close resource in case of OutOfMemoryError

Issue: SPR-10755
(cherry picked from commit 2e4eb9f)
This commit is contained in:
Juergen Hoeller
2013-07-24 14:39:15 +02:00
committed by unknown
parent 8feeec4a60
commit c1dc4e2c75
7 changed files with 10 additions and 11 deletions

View File

@@ -236,7 +236,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
}
}
catch (Exception ex) {
catch (Throwable ex) {
DataSourceUtils.releaseConnection(con, this.dataSource);
throw new CannotCreateTransactionException("Could not open JDBC Connection for transaction", ex);
}