EJB Online Quiz


Advertisements

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 : C

Explaination

Entity beans represents persistent data storage. User data can be saved to database via entity beans and later on can be retrived from the database in the entity bean.

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 : A

Explaination

name attribute in @javax.ejb.MessageDrivenBean annotation is used to specify 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 - @javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

A - false

B - true

Answer : B

Explaination

@javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

Answer : D

Explaination

@PrePassivate - method is invoked when a bean is put back to bean pool.

Q 7 - Which annotation is used to inject an ejb into another ejb?

A - @EJB

B - @Resource

C - Both of the above.

D - None of the above.

Answer : A

Explaination

@EJB annotation is used to inject other EJB reference.

Answer : A

Explaination

Atomic - If any of work item fails, the complete unit is considered failed. Success meant all items executes successfully.

Answer : A

Explaination

REQUIRED - Indicates that business method has to be executed within transaction otherwise a new transaction will be started for that method.

Answer : B

Explaination

Any exception which is not caused by business logic or business code. RuntimeException, RemoteException are SystemException will be treated as system level exception.

ejb_questions_answers.htm
Advertisements