2 Replies Latest reply on Oct 10, 2003 5:26 PM by demiante

    configure : instance-pool/instance-cache

    christophe christophe Newbie


      I am trying to configure my stateful session bean. But I don't understand the difference between "the instance-pool" and the "instance cache". When I change the parameters (cache-policy-conf) as "min-capacity", "max-capacity" and "max-bean-age" I see that the ejbActivate method and ejbPassivate are called. But when I change the parameter (container-pool-conf) as "MaximumZise" I do not see change.

      <min-capacity>1</min-capacity> <max-capacity>3</max-capacity>
      1 1 true

      Can you give an explanation between instance-pool and instance-cache.



        • 1. Re: configure : instance-pool/instance-cache
          Adrian Brock Master

          The pool is a collection of unassociated beans.
          When a request comes in, a bean is selected from the
          pool and attached to a bean context.
          When the request finishes, the bean is removed from the
          context and placed back in the pool, unless...

          If you have a cache, the bean may be placed in the cache
          and not returned to the pool after the request. In future
          when somebody asks for the same key (either the internal
          session key for Stateful Session beans or the primary key
          for entity beans) the same bean is reused.

          If the cache is too full or an error occurs while using
          the bean, the bean can be passivated which involves
          removing the context and maybe returning the bean
          to the pool.

          In simpler terms:
          The pool is a collection of "raw" EJBs with no data
          (all equivalent)
          The cache is a collection of EJBs associated with
          some data (none are equivalent to each other).


          • 2. Re: configure : instance-pool/instance-cache
            demiante Newbie

            Hello Adrian and folks,
            I read the Jboss Administration (payed documentation) and looked in the net but I didn't get this questions answered entirely yeat:

            1)What is cache miss?
            2)When it happens? in what cases?

            My only hint is when the cache is full, like number-of-beans-activate = max-capacity-of-cache and another bean must to be create so the LRU bean must to be passivate.
            If the cache miss only occurs in this case that i mentioned so why the resizer task limit the enlargement of the cache to the size of the <max-capacity> tag value?

            I don't know if I get my questions understood but i appreciate any help,