Stateful session beans are more resource intensive than stateless session beans. The stateful implementation remains bound to the client that creates them until the client calls the remove method or EAServer removes the instance because it has timed out. You can minimize the performance impact of using stateful session beans by following these recommendations:
Always call the remove method Code your clients to call remove so that EAServer knows when the instance is no longer needed.
Set an instance timeout Set the component Instance Timeout property as described in he Instance Timeout setting on the Component properties: Resources tab in EAServer Manager or by setting the com.sybase.jaguar.component.timeout property with jagtool. The timeout ensures removal or passivation of component instances when the client crashes or the end user walks away from their desk.
Optionally configure passivation By default, EAServer destroys instances that time out. In single server deployments, you can optionally configure passivation so that EAServer saves the instance state data to a remote database before removing the instance from memory. Passivation allows EAServer to free memory used by idle instances, while still allowing clients to invoke the instance. If the client calls the instance again, EAServer restores the state data from the database. For more information, see “Using EJB activation and passivation” in Chapter 28, “Configuring Persistence for Stateful Session Components,” in the EAServer Programmer’s Guide.
Configure replication for clustered deployments In a clustered deployment, you must configure the mechanism that EAServer uses to replicate state data between servers in the cluster. See “Component state replication” for more information.
Configure the maximum allowed instances If clients activate too many instances at once, the server can run out of memory. To prevent this, set a limit on the number of instances that can be active. Set the Maximum Active Instances field on the Resources tab in the EAServer Manager Component Properties dialog box or by using jagtool to set the com.sybase.jaguar.component.objects property.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |