Defensive catching of any Throwable subclasses instead of just Error

Issue: SPR-14329
Issue: SPR-14323
(cherry picked from commit a9fda3e)
This commit is contained in:
Juergen Hoeller
2016-06-04 00:17:20 +02:00
parent 2fd691b340
commit e219576414
5 changed files with 18 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
@@ -142,7 +142,7 @@ public class TransactionTemplate extends DefaultTransactionDefinition
rollbackOnException(status, err);
throw err;
}
catch (Exception ex) {
catch (Throwable ex) {
// Transactional code threw unexpected exception -> rollback
rollbackOnException(status, ex);
throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception");