8 Replies Latest reply on Sep 13, 2016 11:07 AM by Dietrich Schmidt

    Wildfly 10.1.0 blocks calls to Singleton EJBs in PostConstruct

    Dietrich Schmidt Newbie



      Wildfly 8.2.0 and 10.0.0 work fine with a Singleton Bean, which has a @Postconstruct method and in this method several threads are created with the ManagedExecutorService. These  threads call a method in another Singleton EJB, which has been injected.


      This call is blocked in Wildfly 10.1.0 until the Prostconstruct thread has ended.


      A simple project is attached, which demonstrated the problem and which I used to verify the problem.


      Is this a bug in Wildfly 10.1.0 or is this behaviour required by the spec and Wildfly 10.0.0 and 8.2.0 were wrong to allow this?


      In the real live application I am doing some serious initialization work in the @PostConstruct, because I want to be sure that the application is in a well-defined state and ready to answer requests if the deployment is successful. Thus I create as many threads as cores are available and do this intialization work in parallel. I can go back to a single-threaded variant but I am also worried about this wildfly 10.1.0 behaviour.


      Any recommendations?


      best regards