IBM


13.4.2 EJB container caching option for stateful session beans

Similarly to entity beans, you can specify which caching strategy to use for stateful session beans. This caching option specifies the point at which an enterprise bean is activated and placed in the cache. Removal from the cache and passivation are also governed by this setting. Valid values are:

- Once (default)

Choosing Once indicates that the bean is activated when it is first accessed in the server process. It is passivated and removed from the cache at the discretion of the container, for example, when the cache becomes full.

- Transaction

Choosing Transaction indicates that the bean is activated at the start of a transaction. It is passivated and removed from the cache at the end of the transaction.

You can set this caching option by opening the EJB deployment descriptor for the EJB module. The Activate at setting is found on the Bean tab (Figure 13-17). Select the bean and scroll down to the Bean Cache category.

Figure 13-17 Activate settings for stateful session beans

The Load at option does not have any effect on Stateful Session EJBs.


Redbooks ibm.com/redbooks

Next