[
https://issues.apache.org/jira/browse/TOMEE-2228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16595966#comment-16595966
]
Romain Manni-Bucau commented on TOMEE-2228:
-------------------------------------------
Hi Jonathan,
We can add a flag to enable it thanks to a manual user operation but I wouldnt
do it by default since it is highly not portable and it would be an issue for
users using tomee in a test environment and another server elsewhere. This
scope has to respect its spec and not cdi best practises (but +1000 to make an
issue in jta).
On the leak: it doesnt leak cause there is nothing to destroy at container
shutdown since the context is a threadlocal destroyed elsewhere and not
specific to cdi.
> CDI Event should fire when TransactionScope is created
> ------------------------------------------------------
>
> Key: TOMEE-2228
> URL: https://issues.apache.org/jira/browse/TOMEE-2228
> Project: TomEE
> Issue Type: Wish
> Components: TomEE Core Server
> Affects Versions: 7.0.5
> Reporter: Jonathan S Fisher
> Priority: Minor
>
> Given the code:
> {code}
> @ApplicationScoped
> public class MyClass {
> public void processConversationScopedInit(@Observes
> @Initialized(TransactionScoped.class) Object payload) {}
>
> public void processConversationScopedDestroyed(@Observes
> @Destroyed(TransactionScoped.class) Object payload) {}
> }
> {code}
> One would expect these events to fire. Although not specifically mandated in
> the spec, it does encourage portable extensions to fire @Initialized(X.class)
> where X is a custom scope.
> Also, not sure if this is a bug or not, but it appears the TransactionScope
> may leak upon Container shutdown, as TransactionScope is not listed here:
> https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java#L284
> * https://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#request_context
> * TOMEE-1282
> * TOMEE-1315
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)