Defensive catching of any Throwable subclasses instead of just Error

Issue: SPR-14329
This commit is contained in:
Juergen Hoeller
2016-06-04 00:17:20 +02:00
parent f657952cee
commit a9fda3e7e2
5 changed files with 11 additions and 11 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");