Is Spring Retry guaranteed to work with Spring\'s @Transactional
annotation?
Specifically, I\'m trying to use @Retryable
for optimistic loc
By default Spring Retry builds advice with the same LOWEST_PRECEDENCE order - take a look at the RetryConfiguration. However, there is a pretty simple way to override this order:
@Configuration
public class MyRetryConfiguration extends RetryConfiguration {
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE;
}
}
Make sure to omit the @EnableRetry annotation to avoid default RetryConfiguration be taken into account.