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

Explaination

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

Answer : D

Explaination

mappedName attribute in @javax.ejb.MessageDrivenBean annotation is used to specify the JNDI name of the message driven bean.

Answer : D

Explaination

description attribute in @javax.ejb.MessageDrivenBean annotation is used to provide description of the message driven 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 : C

Explaination

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

Answer : B

Explaination

@PostLoad - is invoked when a record is fetched from database and loaded into the entity.

Answer : A

Explaination

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

Answer : A

Explaination

Start - When to start a transaction in a business method.

ejb_questions_answers.htm
Advertisements