Explain Stateful session bean life cycle?

Answer Posted / srinivas

* A stateless session bean instance’s life starts when
the container invokes newInstance() on the session bean
class to create a new instance. Next, the container calls
setSessionContext() followed by ejbCreate() on the instance.
The container can perform the instance creation at any
time—there is NO relationship to a client’s invocation of
the create() method.
* The session bean instance is now ready to be
delegated a business method call from any client.
* When the container no longer needs the instance
(usually when the container wants to reduce the number of
instances in the method-ready pool), the container invokes
ejbRemove() on it. This ends the life of the stateless
session bean instance.

Is This Answer Correct ?    4 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between ejb and spring?

537


What does statelessness mean?

531


When was ejb developed?

574


Define Clone?

599


What is stateless programming?

605






Is it possible to write two ejb’s that share the same remote and home interfaces, and have different bean classes? If so, what are the advantages/disadvantages?

525


How does ejb work in java?

550


What is ejb and its types in java?

508


What is session bean?

544


Why do we use @requestmapping?

524


Name the acid properties of a transaction.

550


What is @autowired required false?

586


What are the attributes of transaction in ejb?

511


What are the callback annotations for entity bean?

518


Which services are provided to ejb components by the ejb container?

734