-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using @Retry and @Transactional on the same method #605
Comments
You can modify the priority of the Fault Tolerance interceptor by setting the |
The more I think about, the less I am convinced that just changing the priority would really fix this thoroughly. I think that Retry actually only makes sense in combination with REQUIRES_NEW - otherwise, the retry attempts might still end up sharing the same transaction with all kinds of difficult to diagnose side-effects. So for my use case, I actually want to enforce that Retry is only used with REQUIRES_NEW (because I think that constellation should be “safe”). That’s why I also added the other interceptors which throw an exception when trying to retry a method with TxType.REQUIRED or MANDATORY. |
As I said on the SmallRye Fault Tolerance issue, I haven't been involved in MicroProfile Fault Tolerance since the beginning, but my opinion is that MicroProfile Fault Tolerance was designed chiefly for guarding network interactions and when you try to apply it elsewhere, all kinds of cracks start to appear. I think this is one of those. |
That is a valid point. Maybe I need to rethink my use-case again. |
As an application developer I need to be able to use the
@Retry
annotation in a JTA-enabled application which enables me to provide fault tolerance to transactional methods.However, this is currently not possible because the specification currently states that:
while the JTA specification states that:
This means that the transactional interceptor will run before the fault tolerance interceptor and all retries will take place in the same transaction. This is an issue for many reasons:
The spec should make clear what happens when combining
@Retry
and@Transactional
. One possibility could be introducing another annotation which specifies what happens to the transaction during retries.Also see: smallrye/smallrye-fault-tolerance#629
The text was updated successfully, but these errors were encountered: