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

A message driven bean is a type of enterprise bean which is invoked by EJB container when it receives a message from queue or topic. Message driven bean is a stateless bean and is used to do task asynchronously.

Answer : B

Explaination

A remote session bean is used in EJB if ejb client is in different environment where ejb session bean is to be deployed.

Answer : C

Explaination

description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.

Answer : D

Explaination

description attribute in @javax.ejb.MessageDrivenBean annotation is used to provide description of the message driven bean.

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

A - true

B - false

Answer : A

Explaination

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

Answer : D

Explaination

@PostRemove - method is invoked after an entity is deleted from the database.

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

Explaination

Failed - Identify failure scenario when a transaction is to be rollback.

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