5 Replies Latest reply on Feb 15, 2007 10:51 AM by Aleksander Bai

    Sizing a Stateless Session Bean Pool Size

    Mark Spritzler Apprentice

      I feel like I am asking a stupid question, but where do you configure your Stateless Session Bean Pool Size. I would assume that you can create a pool for each different SLSB you have, so one could have min/max say 20/50 and have a different SLSB be min/max 100/200


        • 1. Re: Sizing a Stateless Session Bean Pool Size
          K A Newbie

          Look for these entries in your standardjboss.xml:



          • 2. Re: Sizing a Stateless Session Bean Pool Size
            Bill Burke Master

            This person is incorrect...

            By default, SLSBs use a ThreadLocal pool. So, one instance is created per thread. TheadLocal pools allow you to avoid synchronization.

            So basically, you have, by default as many SLSB instances as your greatest volume of concurrent requests.

            Download RC9 release and read the documentation on how to change things. For instance, there is a StrictPool setting that will set a max and block requests if that max is met.

            • 3. Re: Sizing a Stateless Session Bean Pool Size
              Varun Narang Newbie

              Here I've some problem quite aligned to the subject.
              Actually I want to restrict max no of StatefulSessionBean instances in the EJB3.0 configuration. My main objective is to make methods postActivate() (decorated with anno. @PostActivate) and prePassivate (with @PrePassivate) get called, for a test environment.

              Please help me with the configuration of EJB3.0.
              Thanks & Regards,
              Varun Narang.

              • 4. Re: Sizing a Stateless Session Bean Pool Size
                Alexander Medina Newbie

                You can also set that in the standardjboss.xml file. Just scroll down, till you find that:

                 <container-name>Standard Stateful SessionBean</container-name>

                max-bean-age is the time in seconds, a stateful bean has to be idle before it gets passivated.
                the overager-period is the time period, the beans get checked for passivation.

                Alternatively, you can copy the whole container configuration to a jboss.xml file which has to be located in the META-INF-Directory of your Bean .jar.

                • 5. Re: Sizing a Stateless Session Bean Pool Size
                  Aleksander Bai Newbie

                  If the pool size for a bean is set to 1, would the second request be blocked or will it simply use the same instance??

                  I'm trying to share state between stateless beans, and therefore want to set the pool size to 1. However, not if the second/third request is blocked.