what is the difference between stateless and stateful
sessions?

Answer Posted / amar

1.when we use stateless, we look up the bean, call a method,
we give up the bean reference, the bean return to pool;
2.when we use stateful, we look up the bean and keep the
reference for a long time(may several minutes to hours, say
shopping cart), we call methods sometime. if we use
stateless, each client will always associated one bean in
memory, it costs a lot! for stateful, we don't need to worry
about it too much, the container will passivate some of them
to disk when resource is not enough. I think it is the real
benefit of stateful session bean.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create ejb project in eclipse?

528


What causes statelessness?

476


What is the advantage of using entity bean for database operations, over directly using jdbc api to do database operations?

548


List down the steps for the demonstration of ejp persistence mechanism.

621


A client wants to preserve the reference to the ejbhome object of an enterprise bean instance and use it later. Which of the following can be serialized for this purpose?

524






Who took over ejb?

596


What is bean-managed transaction?

561


What is stateless session bean?

552


What is stateless and stateful session bean in ejb?

491


What is session bean in ejb?

518


why Bean class implements all business method of Remote interface but bean bean class not implements the remote interface

2020


Why do we use @requestmapping?

518


Name the acid properties of a transaction.

546


How can a session bean be configured for transactions of bean-managed?

576


Can tomcat run ejb?

534