2 Replies Latest reply on May 26, 2017 8:31 AM by veselroger

    Context Services: what kind of contexts propagated by WildFly

    veselroger

      We are using WildFly10.1.0.Final.

      We have setted ee subsystem and now we have some questions.

      We have used this documentation for EE subsystem Configuration:

      https://docs.jboss.org/author/display/WFLY10/EE+Subsystem+Configuration

      This documentation says: "WildFly Context Services are also used to propagate the context from a Java EE application invocation thread, to the threads internally used by the other EE Concurrency Utilities".

      Our question: What types of context is talking about?

       

      Also, in this documentation mentioned JSR 236 for EE Concurrency Utilities.

      Link for JSR-236: https://jcp.org/aboutJava/communityprocess/final/jsr236/index.html

       

      Chapter 2.3 of JSR-236 said, that "The types of contexts to be propagated from a contextualizing application component

      include JNDI naming context, classloader, and security information. Containers must support propagation of these context types. In addition, containers can choose to support propagation of other types of context."

       

      CDI:

      JSR-236 said that "CDI beans can be used as tasks. Such tasks could make use of injection if they are themselves components or are created dynamically using various CDI APIs.".

      But, WildFly use WELD as CDI implementation.

      And Weld documentation said "they are no longer active in the new thread, nor able to access their contextual data" about new thread context.

      Link: http://weld.cdi-spec.org/documentation/#0

      Also, when we try get ConversationScoped CDI bean we get an error: "WELD-001303: No active contexts for scope type javax.enterprise.context.ConversationScoped".

      Question: There is NO CDI context propagation?

       

      JTA:

      JSR-236 show JTA on schema.

      Oracle documentation says that: "All tasks run without an explicit transaction (they do not enlist in the application component's transaction). If a transaction is required, use a UserTransaction instance. A UserTransaction instance is available in JNDI using the name: "java:comp/UserTransaction"".

      Link: https://docs.oracle.com/javaee/7/api/javax/enterprise/concurrent/ManagedExecutorService.html

      Question: There is NO JTA context propagation?

       

      JPA:

      JPA Context propagated across transactions.

      If there is no transaction propagation - there is no JPA Context propagation.

      Question: is it true?

       

      If there is no CDI, JTA, JPA contexts propagation, what kind of context will be propageted if we use WildFly Context Services?

       

      Many thanks for considering my question.

        • 1. Re: Context Services: what kind of contexts propagated by WildFly
          tremes

          Hi,

          Wrt CDI - context propagation with using EE concurrent utilities is unfortunately undefined. You can check "2.3.2.1 Tasks and Contexts and Dependency Injection (CDI)" in "Concurrent utilities for Java EE". So the propagation of request, session and conversation context is not working. Application context is available.

           

          This could be workarounded with CDI 2.0 (which is targeting EE 8 and thus not part of WildFly yet) with programmatic (or by using interceptor) request context activation.

          1 of 1 people found this helpful
          • 2. Re: Context Services: what kind of contexts propagated by WildFly
            veselroger

            Thank you for you response.

            CDI: Only Application context propagation.

             

            It will be great to know about other contexts.

            Which another contexts was implicit in the phrase "propagate the context from a Java EE application invocation"?