Join identical catch branches

See gh-2052
This commit is contained in:
igor-suhorukov
2018-12-14 02:03:33 +03:00
committed by Stephane Nicoll
parent 93e7a0a59d
commit a218bf40cd
5 changed files with 16 additions and 49 deletions

View File

@@ -121,14 +121,10 @@ public class SpringJtaSynchronizationAdapter implements Synchronization {
boolean readOnly = TransactionSynchronizationManager.isCurrentTransactionReadOnly();
this.springSynchronization.beforeCommit(readOnly);
}
catch (RuntimeException ex) {
catch (RuntimeException | Error ex) {
setRollbackOnlyIfPossible();
throw ex;
}
catch (Error err) {
setRollbackOnlyIfPossible();
throw err;
}
finally {
// Process Spring's beforeCompletion early, in order to avoid issues
// with strict JTA implementations that issue warnings when doing JDBC