This must be the same contextual instance behind in both scenarios. 

I guess you debugged into the ApplicationScoped bean (e.g. into a getter) and 
verified it that way and did not only look at the proxy (which never gets fully 
initialized).

If you really did look at the Contextual Instance and not only at the proxy, 
and if you did get two separate instances then this is really a failure which 
you should open a PMR for.


LieGrue,
strub


On Wednesday, 14 May 2014, 4:39, Lars-Fredrik Smedberg <[email protected]> 
wrote:
 
Hi!
>
>
>We are using Websphere (right now Liberty Profile April Beta since we use 
>Liberty Profile in development and need the async EJB functionality) to test 
>CDI, EJB and @Asynchronous method calls.
>
>
>The scenario is the folowing:
>
>
>1. An @ApplicationScoped bean is configured by an Event fired by 
>RequestContextListener (we could not fire the event from a 
>ServletContextListener, more on that in another post).
>2. I have debugged and can see that the event reaches the @ApplicationScoped 
>bean and it gets initialized.
>3. The @Asynchronous method on the EJB injects and uses the @ApplicationScoped 
>bean BUT the contextual instance is NOT the same as the one in 2 above (and 
>its therefore not initialized properly).
>
>
>If I remove the @Asynchronous annotation from the EJB method and re-run the 
>scenario above everything works fine (the contextual instance of the 
>@ApplicationScoped bean is the same).
>
>
>I see in 6.7.3 of the CDI 1.0 specification (1.0 since we use WAS) that the 
>Application context should be shared and the @Asynchronous scenario above 
>should work.
>
>
>Did I misunderstand something or is this a bug that we should report to IBM?
>
>
>Regards
>Lars-Fredrik
>
>
>
>
>
>-- 
>Med vänlig hälsning / Best regards
>
>Lars-Fredrik Smedberg
>
>STATEMENT OF CONFIDENTIALITY:
>The information contained in this electronic message and any
>attachments to this message are intended for the exclusive use of the
>address(es) and may contain confidential or privileged information. If
>you are not the intended recipient, please notify Lars-Fredrik Smedberg
>immediately at [email protected], and destroy all copies of this 
>message and any attachments. 
>
>

Reply via email to