Is there a way to replace the following Spring configuration in xml:
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" no-rollback-for="MyNoCausingRollbackException" />
</tx:attributes>
with annotation or java configuration?
My goal is to customize the behavior of each transaction in this way, so throwing MyNoCausingRollbackExceptioninside a method annotated with @Transactionalwill not execute the current transaction. I would like to avoid defining this behavior every time, using Transactional(noRollbackFor = ResourceNotFoundException.class)for each method that might raise such an exception.
source
share