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

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. Session bean gets destroyed as soon as user session terminates.

Q 2 - Which of the following bean is represents persistent data storage?

A - session bean.

B - entity bean.

C - message driven bean.

D - None of the above.

Answer : B

Explaination

Entity bean represents persistent data storage.

Answer : D

Explaination

mappedName attribute in @javax.ejb.EJB annotation is used to specify the JNDI name of the referenced bean.

Answer : D

Explaination

@javax.ejb.Remote annotation is used to specify Remote interface(s) of a session bean. This remote interface states the business methods of the session bean (which can be stateless or stateful). This interface is used to expose the business methods to reote clients which are running in different deployment/application as EJB.

Answer : C

Explaination

@PreRemove - method is invoked when an entity is deleted from the database.

Answer : B

Explaination

@PostLoad - is invoked when a record is fetched from database and loaded into the entity.

Answer : D

Explaination

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

Answer : C

Explaination

When System Exception occurs, ejb container intercepts the exception, rollbacks the transaction and start the clean up tasks. It wraps the exception into RemoteException and throws it to the client.

ejb_questions_answers.htm
Advertisements