Stateful session bean: NRU & idle-timeout-seconds

Discussions

EJB programming & troubleshooting: Stateful session bean: NRU & idle-timeout-seconds

  1. Stateful session bean: NRU & idle-timeout-seconds (5 messages)

    As per edocs from BEA, Weblogic App Server http://edocs.beasys.com/wls/docs81/ejb/session.html, the container has 2 strategies for maintaining the cache and passivating the stateful session beans. 1. LRU 2. NRU - This is the default strategy and also an eager remove strategy in which the container decides to remove the bean instead of passivating after idle-timeout-seconds. In my stateful session bean(deployed on weblogic 8.1 sp 5), the cache-type strategy is default(so i assume it to be NRU). Now even after the expiration of idle-timeout-seconds, the beans are not removed from cache. Neither are the beans passivated. The stateful session bean instances continue to stay in the cache. Any pointers to this?
  2. How are you verifying the behavior? Can you give more details on your strategy at both client side and server side? Subramanian, Kumar [kumar at eminenttech dot com] J2EE Architect Eminent Technology Solutions (ETS) [www.eminenttech.com] Software / Portals / Alfresco / Outsourcing / Proteomics
  3. For my stateful session bean: idle-timeout-seconds is 120 seconds. I monitor for long intervals but the bean doesnt gets removed, i verify it as below: 1. Go to weblogic console and monitor the stateful session beans, it shows the current number of beans in cache and also the passivation counts. The count of the beans in cache doesnt decrease after the expiration of timeout seconds. 2. Also, in my stateful session beans i have put system.out.println in the methods ejbRemove() & ejbPassivate(). They donot get logged after the expiration of timeout seconds.
  4. Whats the max-beans-in-cache set in your weblogic ejb jar? Did you set it to 1 and tried to use the session bean by a client and then allowed it to time out? Subramanian, Kumar [kumar at eminenttech dot com] J2EE Architect Eminent Technology Solutions (ETS) [www.eminenttech.com] Software / Portals / Alfresco / Outsourcing / Proteomics
  5. I haven't specified the max-beans-in-cache explicitly, so i guess the default 1000 beans in cache would be used. Yes, the client to the bean is another transactional stateless session bean. This bean propogates its transaction to the stateful session bean and then allows the stateful session bean to time out after stateful has finished processing.
  6. For NRU you should put pressure on the cache to make the container to passivate or remove on the hit. By default weblogic keeps minimum of 8 beans in NRU cache, you should set max-beans-in-cache to 1 (or any value from 1 to 8) and try to consume these 8 beans from 8 different clients to put pressure on the cache. Subramanian, Kumar [kumar at eminenttech dot com] J2EE Architect Eminent Technology Solutions (ETS) [www.eminenttech.com] Software / Portals / Alfresco / Outsourcing / Proteomics