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.
Q 1 - Which of the following is true about entity bean?
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 - When a remote session bean is used in EJB?
A remote session bean is used in EJB if ejb client is in different environment where ejb session bean is to be deployed.
Q 3 - Which of the following is correct about description attribute in @javax.ejb.Stateless annotation?
description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.
Q 4 - Which of the following is correct about description attribute in @javax.ejb.MessageDrivenBean annotation?
description attribute in @javax.ejb.MessageDrivenBean annotation is used to provide description of the message driven bean.
Q 5 - Which of the following is true about @javax.ejb.Local annotation?
@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.
Q 6 - Which of the following is correct about @PrePersist annotation for a entity bean?
@PrePersist - method is invoked when an entity is created in database.
Q 7 - Which annotation is used to inject an ejb into another ejb?
@EJB annotation is used to inject other EJB reference.
EJB 3.0 provides support for Blob and Clob types using @Lob annotation.
Q 9 - Which of the following is correct about a Success attrribute of Bean Managed Transactions in EJB?
Success - Identify success scenario when a transaction is to be committed.
Q 10 - Which of the following is true about System level exception in EJB?
Any exception which is not caused by business logic or business code. RuntimeException, RemoteException are SystemException will be treated as system level exception.