[jbossts-issues] [JBoss JIRA] (JBTM-3243) Observer method for ApplicationScoped bean destruction creates a new bean
Michael Musgrove (Jira)
issues at jboss.org
Thu Jan 9 14:09:19 EST 2020
Michael Musgrove created JBTM-3243:
--------------------------------------
Summary: Observer method for ApplicationScoped bean destruction creates a new bean
Key: JBTM-3243
URL: https://issues.redhat.com/browse/JBTM-3243
Project: JBoss Transaction Manager
Issue Type: Bug
Components: LRA
Affects Versions: 5.10.1.Final
Reporter: Michael Musgrove
Assignee: Michael Musgrove
Fix For: 5.next
The LRA implementation needs to observe application shutdown in order to perform clean up activities. It achieves this using an ApplicationScoped bean. But when the destroyed event is fired a new bean may be created which is not what we want with an application scoped bean (this behaviour is seen when running as a Quarkus app). Annotating the method with `@ActivateRequestContext` will ensure the correct application scoped bean used. So instead of
{code}
void disableRecovery(@Observes @Destroyed(ApplicationScoped.class) Object ignore)
{code}
use
{code}
@ActivateRequestContext
void disableRecovery(@Observes @Destroyed(ApplicationScoped.class) Object ignore) {
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jbossts-issues
mailing list