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

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

Explaination

EJB Container normally creates a pool of few stateless bean's objects and use these objects to process client's request. Because of pool, instance variable values are not guaranteed to be same across lookups/method calls.

Answer : C

Explaination

activationConfig attribute in @javax.ejb.MessageDrivenBean annotation is used to specify the configuration details of the message-driven bean in operational environment of the message driven 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 : A

Explaination

@PostConstruct - method is invoked when a bean is created for the first time.

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.

Q 8 - EJB 3.0 provides support for Blob and Clob types using @Lob annotation.

A - true

B - false

Answer : A

Explaination

EJB 3.0 provides support for Blob and Clob types using @Lob annotation.

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