Saturday, 15 August 2015

Java Source World: Difference between Stateful session bean and Stateless session bean

Difference between Stateful session bean and Stateless session bean in EJB | Java Source World

     


                                                                   Java Source World              A Java quick reference blog

Difference between Stateful session bean and Stateless session bean in EJB:


Stateful Session in EJB:


Stateful sessionBeans have the passivated and Active state which the Stateless bean does not
have.

Stateful beans are also Persistent session beans. They are designed to service business
processes that span multiple method requests or transactions.

Stateful session beans remembers the previous requests and reponses.

Stateful session beans does not have pooling concept.

Stateful Session Beans can retain their state on behave of an individual client.

Stateful Session Beans can be passivated and reuses them for many clients.

Stateful Session Bean has higher performance over stateless sessiob bean as they are pooled
by the application server.

Stateless Session in EJB:


Stateless Session Beans are designed to service business process that last only for a single
method call or request.

Stateless session beans do not remember the previous request and responses.

Stattless session bean instances are pooled.

Stateless Session Beans donot maintain states.

Stateless Session Beans, client specific data has to be pushed to the bean for each method


invocation which result in increase of network traffic.




Also read:

Enterprise beans 
SessionBeans in EJB



                                                               Java Source World              A Java quick reference blog









No comments:

Post a Comment