[jboss-jira] [JBoss JIRA] (WFLY-5235) CDI interceptors are not called when invoking observer method
Martin Kouba (JIRA)
issues at jboss.org
Wed Sep 2 04:39:05 EDT 2015
[ https://issues.jboss.org/browse/WFLY-5235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104447#comment-13104447 ]
Martin Kouba commented on WFLY-5235:
------------------------------------
I did a quick test (using {{TransactionSynchronizationRegistry}}) and it seems the interceptor is called and transaction is active. Therefore, we really need some more information. I wonder whether this could be a timing issue - for a web application the event is fired during {{ServletContextListener.contextInitialized()}} delivery and some services might not be available/fully initialized at this time (e.g. JPA).
> CDI interceptors are not called when invoking observer method
> -------------------------------------------------------------
>
> Key: WFLY-5235
> URL: https://issues.jboss.org/browse/WFLY-5235
> Project: WildFly
> Issue Type: Bug
> Components: CDI / Weld
> Affects Versions: 9.0.1.Final
> Reporter: Dirk Weil
> Assignee: Martin Kouba
>
> The following code runs with an active transaction on WFLY 8.2.0, but failes with an TransactionRequiredException on WFLY 9.0.1:
> @ApplicationScoped
> public class InitCocktailDemoDataService
> {
> @PersistenceContext
> private EntityManager entityManager;
> @Transactional
> private void createDemoData(@Observes @Initialized(ApplicationScoped.class) Object event)
> {
> this.entityManager.merge(someEntity);
> }
> It seems that interceptors aren't called at all - at least for observers of scope lifecycle events.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list