When are stateless session beans and stateful session beans used?
September 18th, 2006 by uCertify
Leave a reply »
Stateless Session Bean: A stateless session bean does not maintain a conversational state for a particular client. It is appropriate when the following conditions are satisfied:
The bean needs to hold data about the client across method invocation.
The bean state represents the interaction between the bean and a specific client.
The bean manages the work flow of several enterprise beans.
The bean mediates between the client and the other components.
Stateful Session Bean: A stateful session bean is well suited for implementing a business task dedicated to a single client that maintains a conversational state between the bean and the client. It is appropriate when the following conditions are satisfied:
The bean has no specific data for a specific client.
The bean performs a generic task for all clients, in a single method invocation.
The bean is used to fetch only read-only data for clients. Click here to download scja test study guide and practice question.
Download free practice test for SUN SCJA exam.
Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.