Edit EJB Cache Settings

The EJB Container caches stateful instances (Stateful Session Beans and Entity Beans in the ready state) in memory to improve performance. To achieve scalability the container will also selectively move some instances from the cache to persistent storage. Every Stateful Session Bean and Entity Bean class in every enabled application has its own cache. This page allows you to configure the container-wide defaults for cached EJBs. The caching configuration for a particular EJB can be specified in the EJB deployment descriptor and will override these defaults.

The caching works as follows:

The cache will grow as Stateful Session Beans or Entity Beans are accessed by an application. If the cache reaches the maximum size, the container will shrink the cache by the value specified in the Cache Resize Quantity field. Using the algorithm selected from the Victim Selection Policy option, to select candidates, removed entries are passivated to persistent storage. In addition, all entries that have been idle for the number of seconds specified in the Idle Timeout field, will be passivated. On a regular basis, any entries in the cache or persistent storage that have been idle for the Removal Timeout period will be destroyed (or in the case of Entity Beans, returned to the pool). Any attempted access to these entities will result in an error.

Note, if Commit Option C is in effect for a specific Entity EJB then it will be removed from the cache (and back to the pool) at the end of a transaction.

The following table describes the fields and buttons on the screen. The left column lists the fields and buttons; the right column describes the functionality.

Field or Button
Description

Max Cache Size

Specifies the maximum size of the cache.

Cache Resize Quantity

The number of entries that will be passivated if the cache becomes full.

Removal Timeout (secs)

The period (in seconds) for which an entry can be idle in the cache or persistent store before it is destroyed.

Victim Selection Policy

When selecting candidate idle cache entries to passivate, the container will base the decision on the selected policy.

• fifo - select oldest entries first
• lru - select least recently used entries first
• nru - not recently used entries first. A variant of the LRU policy that will yield better performance under low pool activity.

Note that Entity EJBs will always use the fifo victim selection policy.

Idle Timeout (secs)

The period (in seconds) that an entry can be idle in the cache before being considered as a candidate for removal to the persistent store.

Save

Saves your changes to the EJB Container

Reset

Cancels your changes and displays a fresh page in which you can re-do your configuration.

See also

Edit EJB Properties

Edit EJB Pool Settings


Legal Notices