2 Replies Latest reply on May 5, 2014 7:01 AM by mbriskar

    When application is deployed to scaled wildfly 8, too many session instances are created

    mbriskar

      I have a scaled wildfly 8 cartridge on openshift that I am using along with a MongoDB database.

       

      In my Java application I have a Session bean. When this bean is created, it downloads the server status for the current user using REST from server (server is deployed elsewhere).

      The bean can look like this:

       

      @Named("mailinglists")

      @SessionScoped

      public class MySessionBean {

         

          @Inject

          RestClient client;

        

          private Load load;

        

          @PostConstruct

          public void init() {

              load=client.load();

          }

       

      When I deploy this java application to the scaled wildfly 8, I can see on the server's mongodb.log (a log file from the database) a flood of requests from this application. In average, there are 4 requests per second. The application is not accessed by any user, the requests are caused by the session creation and never stop. When I load the status lazily (only when the status is somehow requested and not when the session is created), the server lives peacefully without any logs in mongodb.log.

       

      The question is:

      Is this behavior expected? I found it strange, so I rather report it here. It is not hapenning with a not scaled Wildfly 8 instance. I don't know if this behavior is caused by Wildfly or by Openshift.