-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve transactional observer without jta warning #14968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should also have a tracking issue.
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverInfo.java
Outdated
Show resolved
Hide resolved
The warning now includes, that the observers are still triggered, which is a clearer messaging.
Failure in |
@@ -99,8 +99,9 @@ static ObserverInfo create(String id, BeanDeployment beanDeployment, DotName bea | |||
} else { | |||
info = beanClass.toString(); | |||
} | |||
LOGGER.warnf("The observer %s makes use of %s transactional observers but no " + | |||
"JTA capabilities were detected.", info, transactionPhase); | |||
LOGGER.warnf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the chat I understood we wanted to only show this when !jtaCapabilities
and avoid it entirely in case of no tx in progress? E.g. IMO the condition on L#94 should only check for JTA cappabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the spec https://jakarta.ee/specifications/cdi/2.0/cdi-spec-2.0.html#transactional_observer_methods
A transactional observer method may be declared by specifying any value other than IN_PROGRESS for during
Removing the check for !transactionPhase.equals(TransactionPhase.IN_PROGRESS)
would trigger this warning for normal observers as well when no jta is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use TransactionPhase.IN_PROGRESS
if no explicit Observes.during()
is set, i.e. we use the default value from the annotation. Note that Jandex does not return the default value unless AnnotationInstance.valueWithDefault()
is used (because defaults are stored on the annotation's defining class).
closes #14981