Skip to content
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

JTA CDI should roll-back when intercepted method throws Error #16455

Closed
ochaloup opened this issue Apr 12, 2021 · 1 comment · Fixed by #16459
Closed

JTA CDI should roll-back when intercepted method throws Error #16455

ochaloup opened this issue Apr 12, 2021 · 1 comment · Fixed by #16459
Labels
area/narayana Transactions / Narayana kind/bug Something isn't working
Milestone

Comments

@ochaloup
Copy link
Contributor

ochaloup commented Apr 12, 2021

Currently when a @Transactional method throws an java.lang.Error the transaction is not rolled-back.
But, the java.lang.Error is an un-checked exception and such behaviour is wrong and the transaction should be rolled-back.

This is an issue that was fixed in Narayana - WildFly integration by issue:
https://issues.redhat.com/browse/JBTM-3454
This issue should bring the same fix to Quarkus JTA CDI integration as well.

On JTA spec and Errors

The JTA spec does not define the behaviour precisely for @Transactional. But from other spec or other parts of JTA spec we can consider the Error should rollback the transaction.

The JTA spec says about exceptions for @Transactional annotation:

By default checked exceptions do not result in the transactional interceptor marking
the transaction for rollback and instances of RuntimeException and its subclasses do. 

But from information about Synchronization at JTA spec

An unchecked exception thrown by a registered Synchronization object
causes the transaction to be aborted.

or about transaction handling withing EJB spec

all other exceptions [meant non-application-exceptions]
should "Mark the transaction for rollback."
@ochaloup ochaloup added the kind/bug Something isn't working label Apr 12, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 12, 2021

/cc @manovotn, @mkouba

@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Apr 12, 2021
@manovotn manovotn added area/narayana Transactions / Narayana and removed area/arc Issue related to ARC (dependency injection) labels Apr 13, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 14, 2021
@gsmet gsmet modified the milestones: 2.0.0.Alpha1, 1.13.3.Final Apr 26, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/narayana Transactions / Narayana kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants