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

EJB Container creates a separate stateful session bean to process client's each request. As soon as request scope is over, statelful session bean is destroyed.

Answer : C

Explaination

description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.

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

Explaination

@PreUpdate - method is invoked before an entity is to be updated in the database.

Q 7 - Which annoatation is used to inject SessionContext into an ejb?

A - @EJB

B - @Resource

C - Both of the above.

D - None of the above.

Answer : B

Explaination

@Resource annotation is used to inject SessionContext into an ejb.

Q 8 - Which of the following types of java classes can be mapped using @Lob annotation?

A - byte[]

B - String

C - Serializable Object

D - All of the above.

Answer : D

Explaination

All of the above classes can be mapped using @Lob annotation.

Answer : A

Explaination

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

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