1 Reply Latest reply on Sep 19, 2010 8:15 AM by Marcel Kolsteren

    CDI Rquest context and local EJBs

    Wujek Srujek Newbie

      Hi. I would like to as whether the Request context (@RequestScope) is supported by calls to local EJB. As per the specs, it is not - it explicitly says, among others, that it is available during remote invocations, so I guess it is not available for local calls.
      Is this a wrong interpretation? If it really is the case, why is this limitation enforced? Is there any technical reason for that?

        • 1. Re: CDI Rquest context and local EJBs
          Marcel Kolsteren Apprentice

          I suppose you're referring to section 6.7.1 of the JSR-299? You probably missed the consequences of this sentence:

          The context associated with a built-in normal scope propagates across local, synchronous Java method calls, including invocation of EJB local business methods.

          When you combine this with the guarantees about an active request scope during servlet calls, web service invocations, remote EJB business method invocations, etcetera, you can derive that in most practical cases the request context will just propagate into any of your EJB local business methods. So in practice, the request scope will be active during EJB local business method calls.