|
INTERVIEW QUESTIONS
J2EE
EJB
DETAILS
Question: What is the life cycle of MDB?
Answer: The lifetime of an MDB instance is controlled by the container. Only two states exist: Does not exist and Ready , as illustrated in the following figure: The life of an MDB instance starts when the container invokes newInstance() on the MDB class to create a new instance. Next, the container calls setMessageDrivenContext() followed by ejbCreate() on the instance. The bean then enters the Ready state and is ready to consume messages. When a message arrives for the bean, the container invokes the onMessage() method of one of the available instances, passing a Message object in argument. Message s can be consumed and processed concurrently by using multiple instances of the same type. The container invokes ejbRemove() on the bean instance when it no longer needs the instance. The bean instance can perform clean up operations here.
|
|
|
Category |
EJB Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9803 users |
Added on |
5/27/2011 |
Views |
76454 |
Rate it! |
|
|
Question:
What is the life cycle of MDB?
Answer:
The lifetime of an MDB instance is controlled by the container. Only two states exist: Does not exist and Ready , as illustrated in the following figure: The life of an MDB instance starts when the container invokes newInstance() on the MDB class to create a new instance. Next, the container calls setMessageDrivenContext() followed by ejbCreate() on the instance. The bean then enters the Ready state and is ready to consume messages. When a message arrives for the bean, the container invokes the onMessage() method of one of the available instances, passing a Message object in argument. Message s can be consumed and processed concurrently by using multiple instances of the same type. The container invokes ejbRemove() on the bean instance when it no longer needs the instance. The bean instance can perform clean up operations here. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is local interface. How values will be passed?
|
View Answer
|
|
What is the difference between local interface and remote interface?
|
View Answer
|
|
What is EJB Query Language?
|
View Answer
|
|
What is ACID?
|
View Answer
|
|
What are the various isolation levels in a transaction and differences between them?
|
View Answer
|
|
What is the difference between activation and passivation?
|
View Answer
|
|
What is the difference between activation and passivation?
|
View Answer
|
|
What is Instance pooling?
|
View Answer
|
|
What is the difference between HTTPSession and Stateful Session Bean?
|
View Answer
|
|
How do you check whether the session is active in Stateful session bean?
|
View Answer
|
|
What is the difference between find and select methods in EJB?
|
View Answer
|
|
What are the optional clauses in EJB QL?
|
View Answer
|
|
What is handle in EJB?
|
View Answer
|
|
What is the difference between JNDI context, Initial context, session context and ejb context?
|
View Answer
|
|
What is the difference between sessioncontext and entitycontext?
|
View Answer
|
|
What is the difference between EAR, JAR and WAR file?
|
View Answer
|
|
What is deployment descriptor?
|
View Answer
|
|
What is CMR?
|
View Answer
|
|
What is the difference between CMP 1.1 and CMP 2.0?
|
View Answer
|
|
What is the difference between optimistic locking and pessim
|
View Answer
|