6 Replies Latest reply on Mar 18, 2003 11:51 PM by mgrove

    Restrict number of bean instances

    lumin

      hi ervyone,

      currently i'm doing some performance test's. For this purpose i'd like to restrict the number of bean instances, for a individual jar-application (not for the whole container). By editing jboss.xml entries container configuartion, instance-pool and instance-case, i'm not able to achive this task. Any suggestions? Thanks, in advance, lumin

        • 1. Re: Restrict number of bean instances

          > purpose i'd like to restrict the number of bean
          > instances, for a individual jar-application (not for
          > the whole container). By editing jboss.xml entries
          > container configuartion, instance-pool and
          > instance-case, i'm not able to achive this task. Any
          > suggestions? Thanks, in advance, lumin

          You can specify alternative configurations in the jboss.xml deployment descriptor (either in the standaardjboss.xml or in the one in your ejb jar) and you can specify with each EJB which configuration to use.

          • 2. Re: Restrict number of bean instances
            lumin

            I already checked this out ba editing the web apps jboss. xml. Refering to jboss docu the element container-pool-conf (Maximum size)allows to achieve this. I tested this on JBoss 3.0.5. where this is a hard limit. Unfortunately this didn't work. Any suggestions why?

            regards

            • 3. Re: Restrict number of bean instances
              lumin

              I already checked this out ba editing the web apps jboss. xml. Refering to jboss docu the element container-pool-conf (Maximum size)allows to achieve this. I tested this on JBoss 3.0.5. where this is a hard limit. Unfortunately this didn't work. Any suggestions why?
              regards lumin

              • 4. Re: Restrict number of bean instances
                lumin

                I already checked this out ba editing the web apps jboss. xml. Refering to jboss docu the element container-pool-conf (Maximum size)allows to achieve this. I tested this on JBoss 3.0.5. where this is a hard limit. Unfortunately this didn't work. Any suggestions why?

                • 5. Re: Restrict number of bean instances
                  mgrove

                  dunno if you fixed your problem - if so, please post the solution.

                  if not, i may be able to help...

                  i posted a similar question to the EJB/JBoss forum a few days ago (haven't gotten a response). i'm also trying to use the MaximumSize option to limit the number of bean instances. one thing you may have missed is the strictMaximumSize flag (which is documented less heavily than MaximumSize). unless it is set, the MaximumSize option is not a hard limit. e.g. you'll want content like the following in your jboss.xml

                  <container-pool-conf>
                  5
                  true
                  </container-pool-conf>

                  this didn't work exactly how i expected it to, but it may work for you. in my case, i share a SLSB remote reference across multiple threads, and i wished to limit the number of concurrent invocations of it. my MaximumSize setting of 5 did not enforce this limit.

                  it's possible that jboss considers me to have only one instance of the SLSB, so it does not restrict concurrent access. i'm going to try sharing the home reference instead of the remote reference to see if that affects things.

                  -mike

                  • 6. Re: Restrict number of bean instances
                    mgrove

                    for the next person that comes across this thread in a search - i got a response to my forum post on this topic:

                    http://jboss.org/forums/thread.jsp?forum=47&thread=29670

                    the answer was that the strictMaximumSize setting was not added to 3.0 until 3.0.5. so that setting is silently ignored if you have an older version like i did. i assume it works as expected with 3.0.5 or later, although i have not verified.