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

Explaination

EJB stands for Enterprise Java 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.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 stateful session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : B

Explaination

@javax.ejb.Stateful annotation specifies that a given ejb class is a stateful session 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 : C

Explaination

@PostActivate - method is invoked when a bean is loaded to be used.

Answer : C

Explaination

EJB 3.0 provides specification to intercept business methods calls using methods annotated with @AroundInvoke annotation. An interceptor method is called by ejbContainer before business method call it is intercepting.

Answer : A

Explaination

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

Answer : A

Explaination

MANDATORY - Indicates that business method will execute as part of transaction otherwise exception will be thrown.

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