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

Explaination

mappedName attribute in @javax.ejb.EJB annotation is used to specify the JNDI name of the referenced bean.

Answer : D

Explaination

@javax.ejb.Local annotation is used to specify Local interface(s) of a session bean. This local interface states the business methods of the session bean (which can be stateless or stateful). This interface is used to expose the business methods to local clients which are running in same deployment/application as EJB.

Answer : D

Explaination

@PrePassivate - method is invoked when a bean is put back to bean pool.

Answer : B

Explaination

Default interceptor is invoked for every bean within deployment.

Answer : A

Explaination

Atomic - If any of work item fails, the complete unit is considered failed. Success meant all items executes successfully.

Answer : D

Explaination

JNDI stands for Java Naming and Directory Interface. It is a set of API and service interfaces. Java based applications use JNDI for naming and directory services.

ejb_questions_answers.htm
Advertisements