3 Replies Latest reply on Aug 23, 2004 11:08 AM by Philipp

    Maximum number os bean instances

    Armenio Pinto Newbie

      Hi there,

      Does JBoss provide any configuration to control the maximum number of instances of a given bean? Thanks in advance,

      Arménio Pinto

        • 1. Re: Maximum number os bean instances
          Adrian Brock Master

          <strict-pooling> or cache configuration?

          Read the dtds in docs/dtd

          Regards,
          Adrian

          • 2. Re: Maximum number os bean instances
            Yaron Newbie

            Hi,

            I read many posts that explain how to set max number of bean type (entity / mdb /session)but I can not understand how to control a specific bean number of instances (bean xxx of type mdb for example).

            I guess this connfiguration need to be in ejb-jar.xml or jboss.xml under specific war but not a global configuration like standardjboss.xml that effects all beans under the same type in the container.

            Maybe there is something that I don't get but is it possible?
            If it is possible can anyone post an example?

            I need to set two different MDBs (let's say xxx and yyy) different number of max instances.
            xxx 15 instances
            yyy 3 instances.

            Thanks,

            Yaron

            • 3. Re: Maximum number os bean instances
              Philipp Newbie

              hi,

              i am trying to do the same (limiting the maximum number of instances) for a stateful session bean (i am following the examples given in the book "Mastering Enterprise Java Beans, 2nd edition).

              what i found out is that u have to write a custom jboss.xml to override the cache settings given in the standard configuration. here is mine:

              1 <?xml version="1.0"?>
              2
              3 <enterprise-beans>
              4
              5 <ejb-name>Hans</ejb-name>
              6 2Beans
              7
              8 </enterprise-beans>
              9 <container-configurations>
              10 <container-configuration extends="Standard Stateful SessionBean">
              11 <container-name>2Beans</container-name>
              12 <container-cache-conf>
              13 <cache-policy-conf>
              14 <min-capacity>1</min-capacity>
              15 <max-capacity>2</max-capacity>
              16 </cache-policy-conf>
              17 </container-cache-conf>
              18 </container-configuration>
              19 </container-configurations>
              20


              this should be sufficient; by using the extends-attribute all settings which are not overridden should be taken over from the configuration named "Standard Stateful SessionBean" (which can be found in the standardjboss.xml file).

              however, the settings don't seem to take effect; debugging statements should be issued in the ejbPassivate and ejbActivate methods of the bean, but they are not. no error messages are issued.

              does anyone know what i did wrong, or how this issue can be solved? thanks!