2. What is Session Bean ?
Session bean represents a single client inside the J2EE server. To access the application deployed in the server the client invokes methods on the session bean. The session bean performs the task shielding the client from the complexity of the business logic. There
are two types of session beans, namely: Stateful and Stateless.
Stateful Session Bean: A state of a bean is represented by the values of its instance variables. In a stateful session bean the values of its instance variables represent the state of a client-bean session. When the client quits or leaves the bean the state is terminated.
Stateless Session Bean: This bean does not maintain the state of the conversation between the client and itself. When the client invokes a method on the bean the instance variables of the bean may contain a state but only for the duration of the invocation. Instance variables
are of equal value for all instances of the bean. This means the container can assign any bean to any client, making it very scalable. Typically an application requires less number of stateless beans compared to stateful beans.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment