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
What are the different types of ejb?
What happens when I change a value in the httpsession from inside an ejb?
Is microservice stateless?
What is entity bean in ejb?
What are ejb components?
What are the key benefits of the ejb technology?
What is the procedure of ejb container to handle exceptions?
How does ejbs work?
What does @inject mean in java?
Name the attributes of javax.ejb.ejb.
What is ejbdoclet?
What is difference between ejb 1.1 and ejb 2.0?
Is udp stateless?
Is it possible to have threading in ejb?
Can EJB made to handle multiple transactions?