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

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

Explaination

EntityManager is an interface to do data operations like add/delete/update/find on persistent object. It also helps to execute queries using Query interface.

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 - Which of the following annotation is used to specify Remote interface(s) of a session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : C

Explaination

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

Answer : D

Explaination

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

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

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


ejb_questions_answers.htm

Advertisements