Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: A
- Next: bean-pool

## bean-cache

Specifies the entity bean cache properties. Used for entity beans and stateful session beans.

### Superelements

ejb (`sun-ejb-jar.xml`)

### Subelements

The following table describes subelements for the `bean-cache` element.

Table A–7 `bean-cache` Subelements

Element | Required | Description
--- | --- | ---
max-cache-size | zero or one | Specifies the maximum number of beans allowable in cache.
is-cache-overflow-allowed | zero or one | Deprecated.
cache-idle-timeout-in-seconds | zero or one | Specifies the maximum time that a stateful session bean or entity bean is allowed to be idle in cache before being passivated. Default value is 10 minutes (600 seconds).
removal-timeout-in-seconds | zero or one | Specifies the amount of time a bean remains before being removed. If `removal-timeout-in-seconds` is less than `idle-timeout`, the bean is removed without being passivated.
resize-quantity | zero or one | Specifies the number of beans to be created if the pool is empty (subject to the `max-pool-size` limit). Values are from 0 to MAX_INTEGER.
victim-selection-policy | zero or one | Specifies the algorithm that must be used by the container to pick victims. Applies only to stateful session beans.

### Example

    <bean-cache>
       <max-cache-size>100</max-cache-size>
       <cache-resize-quantity>10</cache-resize-quantity>
       <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
       <victim-selection-policy>LRU</victim-selection-policy>
          <cache-idle-timeout-in-seconds>600</cache-idle-timeout-in-seconds>
       <removal-timeout-in-seconds>5400</removal-timeout-in-seconds>
    </bean-cache>

- Previous: A
- Next: bean-pool

- © 2010, Oracle Corporation and/or its affiliates