Show TOC Start of Content Area

Function documentation Stateful Session Beans' Timeouts  Locate the document in its SAP Library structure

Use

The life cycle of the session beans is managed by the EJB Container. To adjust the passivation settings, the stateful session timeout, and the pool properties to the requirements of your application, you can use the functions, provided by the ejb-j2ee-engine.xml deployment descriptor.

Prerequisites

An EJB assembly project that contains stateful/stateless session beans must have been created.

Features

Stateful Session Timeout

You can set the timeout since the last usage of the session, after which the session will expire (that is, the EJB Container terminates it). This timeout applies to stateful session beans only. Although it is possible to specify this timeout for stateless beans in the NetWeaver Developer Studio, the EJB Container will ignore the specified value.

For more information about setting the stateful session timeout, see Specifying Stateful Session Beans’ Timeouts. The value is stored in ejb-j2ee-engine.xml.

Recommendation

We recommend that you set the value of the stateful session timeout to be longer than the expected duration of the methods; otherwise, system errors may occur.

Although there is a stateful session timeout, we still recommend that you end your sessions by removing the session objects so that you can avoid unnecessary container overhead and processing.

Stateful Session Beans Passivation

The passivation of the stateful session beans is optional. If you do not specify it, the stateful bean instances will not be passivated. They will be active until the session timeout expires or until the client ends the session (calls a remove method from the bean’s home or component interface). The EJB Container uses an LRU algorithm when it passivates the bean instances. You can specify the maximum number of active sessions; when this number is reached the EJB Container passivates the session that was used least recently.

You can also specify the timeout since the bean’s passivation, after which the EJB Container will remove the swapped bean instance and will destroy the session.

For more information about how to specify the passivation, the active sessions limit and the passivation timeout, see Specifying Stateful Session Beans’ Timeouts.

Stateless Session Beans

Stateless session beans do not have options for specifying the passivation timeout because they are not passivated. The EJB Container manages a pool of identical instances. The number of instances in the pool is not determined by clients’ invocations of the create and remove methods of the beans home or local home interfaces, but by the client work load and the deployment properties in ejb-j2ee-engine.xml.

For more information about the pool deployment properties, see Pool Properties.

 

 

End of Content Area