EJB Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to EJB Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : D

Explaination

Session bean stores data of a particular user for a single session. It can be stateful or stateless. It is less resource intensive as compared to entity beans.

Q 2 - Which of the following bean is invoked by EJB container when it receives a message from queue or topic?

A - session bean.

B - entity bean.

C - message driven bean.

D - None of the above.

Answer : C

Explaination

Message driven bean is invoked by EJB container when it receives a message from queue or topic.

Answer : D

Explaination

mappedName attribute in @javax.ejb.MessageDrivenBean annotation is used to specify the JNDI name of the message driven bean.

Answer : C

Explaination

beanName attribute in @javax.ejb.EJB annotation is used to provide name of the referenced bean.

Q 5 - Which of the following annotation is used to specify Local interface(s) of a session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Local

D - @javax.ejb.EJB

Answer : C

Explaination

@javax.ejb.Local annotation is used to specify Local interface(s) of a session bean.

Answer : B

Explaination

@PostPersist - method is invoked after an entity is created in database.

Answer : B

Explaination

Default interceptor is invoked for every bean within deployment.

Answer : D

Explaination

NOT_SUPPORTED - Indicates that business method should not be executed as part of transaction.

ejb_questions_answers.htm
Advertisements