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

What happens when I change a value in the httpsession from inside an ejb?

610


What is an ejb container?

614


What is ejb technology?

576


What is the procedure of ejb container to handle exceptions?

630


What is ejb and why it is used?

580






Can tomcat run ejb?

604


Can more than a single table be mapped in cmp?

640


Explain ejbhome and ejbobject in ejb?

677


What is ejb application?

580


Differentiate Conversational from Non-conversational interactions?

632


What is Enterprise JavaBeans (EJB)?

677


How does ejb invocation happens?

633


How entity beans support container managed persistence?

2021


can u explain about design patterns like singleton,builder,factory

1983


What is session facade in ejb?

642