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

Issue: SPR-10755
This commit is contained in:
Juergen Hoeller
2013-07-24 14:39:15 +02:00
committed by unknown
parent 504d5da71f
commit 2e4eb9fc10
7 changed files with 10 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@@ -196,7 +196,7 @@ public class JmsTransactionManager extends AbstractPlatformTransactionManager
TransactionSynchronizationManager.bindResource(
getConnectionFactory(), txObject.getResourceHolder());
}
catch (JMSException ex) {
catch (Throwable ex) {
if (con != null) {
try {
con.close();