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

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.

Answer : A

Explaination

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

Answer : A

Explaination

name attribute in @javax.ejb.Stateless annotation is used to specify name of the session bean.

Q 4 - Which of the following annotation is used to specify that a given ejb class is a stateless session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : A

Explaination

@javax.ejb.Stateless annotation specifies that a given ejb class is a stateless session bean.

Q 5 - @javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.

A - true

B - false

Answer : A

Explaination

@javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.

Answer : C

Explaination

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

Answer : C

Explaination

Method level interceptor is invoked for a particular method of the bean.

Answer : A

Explaination

A java POJO to be embedded must be annotated as @Embeddable.

Answer : C

Explaination

When Application Exception occurs, ejb container intercepts the exception but returns the same to the client as it is. It does not roll back the transaction unless it is specified in code by EJBContext.setRollBackOnly() method.


ejb_questions_answers.htm

Advertisements