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 : 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 : 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 message driven bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : C

Explaination

@javax.ejb.MessageDrivenBean annotation specifies that a given ejb class is a message driven bean.

Q 5 - @javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

A - false

B - true

Answer : B

Explaination

@javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

Answer : B

Explaination

@PostPersist - method is invoked after an entity is created in 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 - 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 : B

Explaination

Success - Identify success scenario when a transaction is to be committed.

ejb_questions_answers.htm
Advertisements