The container maintains a cache of enterprise bean data for the most used enterprise beans. This allows the container to respond more quickly to requests from other application modules for data from the enterprise beans. This section applies only to stateful session beans and entity beans.
Cached enterprise beans are in one of three states: active, idle, or passivated. An active enterprise bean is currently being accessed by clients. An idle enterprise bean’s data is currently in the cache, but no clients are accessing the bean. A passivated bean’s data is temporarily stored, and read back into the cache if a client requests the bean.
To configure the EJB cache settings using the Admin Console, go to Configuration > EJB Container > EJB Settings.
Adjust the maximum cache size in the Max Cache Size field.
Increase the maximum number of beans to cache to eliminate the overhead of bean creation and destruction. However, if the cache is increased, the server consumes more memory and resources. Be sure your operating environment is sufficient for your cache settings.
Adjust the cache resize quantity in the Cache Resize Quantity field.
When the maximum number of cached beans is reached, the container removes a number of passivated beans from the backup store, set to 32 by default.
If a cached entity bean has been idle a certain amount of time, it is passivated. That is, the bean’s state is written to a backup store.
Adjust the time, in seconds, after which stateful session beans are removed from the cache or passivated store in the Removal Timeout field.
The container decides which stateful session beans to remove based on the policy set in the Removal Selection Policy field. There are three possible policies the container uses to remove beans from the cache:
Not recently used (NRU)
First in, first out (FIFO)
Least recently used (LRU)
The NRU policy removes a bean that hasn’t been used recently. The FIFO policy removes the oldest bean in the cache. The LRU policy removes the least recently accessed bean. By default, the NRU policy is used by the container.
Entity beans are always removed using the FIFO policy.
Restart the Application Server.
For detailed instructions on configuring the EJB pool, Click Help in the Admin Console.