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

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.

Q 2 - Which of the following bean stores data of a particular user for a single session?

A - session bean.

B - entity bean.

C - message driven bean.

D - None of the above.

Answer : A

Explaination

Session bean stores data of a particular user for a single session.

Answer : A

Explaination

name attribute in @javax.ejb.MessageDrivenBean annotation is used to specify name 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 - Which of the following annotation is used to specify Local interface(s) of a session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Local

D - @javax.ejb.EJB

Answer : C

Explaination

@javax.ejb.Local annotation is used to specify Local 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.

Answer : C

Explaination

A transaction is a single unit of work items which follows the ACID properties.

Answer : B

Explaination

REQUIRES_NEW - Indicates that a new transaction is to be started for the business method.

ejb_questions_answers.htm
Advertisements