Bean cache settings are WebSphere® Application Server extensions
to the Enterprise JavaBeans™ specification.
To define bean cache settings for an enterprise bean:
Switch to the J2EE perspective.
In the Project Explorer view, right-click the desired EJB module,
and select Open With > Deployment
Descriptor Editor from the pop-up menu.
On the Beans page of the editor, select
a bean and find the Bean Cache section under the WebSphere Extensions
section.
In the Activate at field, select one of
the following values to specify the point at which an enterprise bean is activated
and placed in the cache:
ONCE: Indicates that the bean activates when
it is first accessed in the server process, and passivates (and is removed
from the cache) at the discretion of the container, for example, when the
cache becomes full. If you select to activate at ONCE, then all five of the
options listed below are available.
ACTIVITY_SESSION: Indicates that the bean activates
and passivates as follows: 1) On an ActivitySession boundary, if an ActivitySession
context is present on activation, 2) On a transaction boundary, if a transaction
context (but no ActivitySession context) is present on activation, or otherwise,
3) on an invocation boundary.
TRANSACTION: Indicates that the bean activates
at the start of a transaction and passivates (and is removed from the cache)
at the end of the transaction.
In the Load at field, select one of the
following values to specify when the bean loads its state from the database.
The value of this setting implies whether the container has exclusive or shared
access to the database:
ACTIVATION: Indicates that the bean loads when
it is activated (regardless of Activate at setting) and implies that the container
has exclusive access to the database.
TRANSACTION: Indicates that the bean loads at
the start of a transaction and implies that the container has shared access
to the database
INTERVAL: (For EJB 2.x only) Indicates that the
bean loads at intervals, determined by the integer set in the Load
at interval field.
DAILY: Indicates that the bean loads its state
on a daily basis.
WEEKLY: Indicates that the bean loads its state
on a weekly basis
If you select INTERVAL for the load at field,
you then indicate the length of time (in seconds) that the reload occurs.
The interval is entered as an integer. The INTERVAL option is only available
when activate is set to ONCE and Load at is set to INTERVAL; at this point,
the reload interval text box is activated.
After you define the bean cache settings, you can click Remove to
remove the bean cache settings.
For more information about bean cache settings,
see the WebSphere Application
Server documentation.