|
|
|
@ -429,8 +429,8 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init |
|
|
|
catch (Throwable ex) { |
|
|
|
catch (Throwable ex) { |
|
|
|
if (txAttr.rollbackOn(ex)) { |
|
|
|
if (txAttr.rollbackOn(ex)) { |
|
|
|
// A RuntimeException: will lead to a rollback.
|
|
|
|
// A RuntimeException: will lead to a rollback.
|
|
|
|
if (ex instanceof RuntimeException) { |
|
|
|
if (ex instanceof RuntimeException rex) { |
|
|
|
throw (RuntimeException) ex; |
|
|
|
throw rex; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
throw new ThrowableHolderException(ex); |
|
|
|
throw new ThrowableHolderException(ex); |
|
|
|
@ -538,8 +538,8 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init |
|
|
|
|
|
|
|
|
|
|
|
String methodIdentification = methodIdentification(method, targetClass); |
|
|
|
String methodIdentification = methodIdentification(method, targetClass); |
|
|
|
if (methodIdentification == null) { |
|
|
|
if (methodIdentification == null) { |
|
|
|
if (txAttr instanceof DefaultTransactionAttribute) { |
|
|
|
if (txAttr instanceof DefaultTransactionAttribute dta) { |
|
|
|
methodIdentification = ((DefaultTransactionAttribute) txAttr).getDescriptor(); |
|
|
|
methodIdentification = dta.getDescriptor(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (methodIdentification == null) { |
|
|
|
if (methodIdentification == null) { |
|
|
|
methodIdentification = ClassUtils.getQualifiedMethodName(method, targetClass); |
|
|
|
methodIdentification = ClassUtils.getQualifiedMethodName(method, targetClass); |
|
|
|
@ -1047,8 +1047,8 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init |
|
|
|
if (txInfo.transactionAttribute != null && txInfo.transactionAttribute.rollbackOn(ex)) { |
|
|
|
if (txInfo.transactionAttribute != null && txInfo.transactionAttribute.rollbackOn(ex)) { |
|
|
|
return txInfo.getTransactionManager().rollback(txInfo.getReactiveTransaction()).onErrorMap(ex2 -> { |
|
|
|
return txInfo.getTransactionManager().rollback(txInfo.getReactiveTransaction()).onErrorMap(ex2 -> { |
|
|
|
logger.error("Application exception overridden by rollback exception", ex); |
|
|
|
logger.error("Application exception overridden by rollback exception", ex); |
|
|
|
if (ex2 instanceof TransactionSystemException) { |
|
|
|
if (ex2 instanceof TransactionSystemException systemException) { |
|
|
|
((TransactionSystemException) ex2).initApplicationException(ex); |
|
|
|
systemException.initApplicationException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
return ex2; |
|
|
|
return ex2; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1059,8 +1059,8 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init |
|
|
|
// Will still roll back if TransactionStatus.isRollbackOnly() is true.
|
|
|
|
// Will still roll back if TransactionStatus.isRollbackOnly() is true.
|
|
|
|
return txInfo.getTransactionManager().commit(txInfo.getReactiveTransaction()).onErrorMap(ex2 -> { |
|
|
|
return txInfo.getTransactionManager().commit(txInfo.getReactiveTransaction()).onErrorMap(ex2 -> { |
|
|
|
logger.error("Application exception overridden by commit exception", ex); |
|
|
|
logger.error("Application exception overridden by commit exception", ex); |
|
|
|
if (ex2 instanceof TransactionSystemException) { |
|
|
|
if (ex2 instanceof TransactionSystemException systemException) { |
|
|
|
((TransactionSystemException) ex2).initApplicationException(ex); |
|
|
|
systemException.initApplicationException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
return ex2; |
|
|
|
return ex2; |
|
|
|
} |
|
|
|
} |
|
|
|
|