Enterprise Java Bean Cache Property Editor

The Enterprise Java Bean Cache property editor enables you to specify the bean cache properties. You open the Enterprise Java Bean Cache property editor by selecting the Bean Cache property and its ellipsis (...) button from the Sun ONE AS pane of an enterprise bean's property sheet.

Max Cache Size

This field specifies the maximum number of beans allowable in cache.

Is Cache Overflow Allowed?

This field specifies if the Max Cache Size value is a hard limit or not. Sometimes many entity beans may need to be added to a cache, exceeding the max-cache-size. When this element is set to true, occasionally the size of the cache can be exceeded. The size will reduce gradually when beans are passivated or removed programmatically.

note  In reality, there is no hard limit. The Max Cache Size limit is just a hint to the cache implementation.

If this value is false and if cache size exceeds the Max Cache Size limit, then CacheOverFlowException is thrown.

Cache Idle Timeout In Seconds

This field specifies the maximum time that a stateful session bean or entity bean is allowed to be idle in cache. When this timeout expires, the bean instance in a pool becomes a candidate for passivation or deletion.

Removal Timeout In Seconds

This field specifies the amount of time a bean instance can remain passivated. If the bean is not accessed before this timeout expires, the passivated bean is removed and is no longer accessible to the client.

Victim Selection Policy

Specifies the algorithm to use for picking victims when a pool needs to shrink.

note  The user cannot plug in his own victim selection algorithm.

The victims are generally passivated into a backup store (typically a file system or database) that is cleaned during startup. At this point, the following implementation choices are possible:

The backup store is monitored by a background thread (or sweeper thread) to remove unwanted entries.

If no victims could be selected, then the value in the Is Cache Overflow Allowed field will determine if a CacheOverFlowException is thrown or not. If the Is Cache Overflow Allowed field is true, then a warning message indicating that cache limit has been exceeded is printed in the log file.

The possible values are First In, First Out (fifo), Least Recently Used (lru), Not Recently Used (nru).


See also
   BMP Bean Property Sheet: Sun ONE AS Tab
CMP Bean Property Sheet: Sun ONE AS Tab

Legal Notices