You are on page 1of 3

EJB3 PreTest Assessment Paper

Q1 what is not a state in the EJB 3 Entity beans life cycle states?
Please choose only one answer:
a) Does not exist
b) Removed
c) Passive
d) Detached


Q2 A Stateful session bean can remember its state and the conversation with the client, but sometimes due
to performance issues, the container needs to remove the Stateful session bean from the memory releasing
its attached resources, what is true about this process?

Please choose all the answers that apply:
a) The Stateful session bean itself persists itself for later activation
b) The EJB container is the one responsible for managing and serializing
the state of the Stateful Session bean
c) Just before this process (passivating), the container calls the ejbPassivate() method
d) Just before this process (passivating), the container calls the ejbRemove() method

Q3. EJB 3.0 specifications are implemented in :
Please choose only one answer:
a) Java EE 3
b) Java EE 4
c) Java EE 5

Q4. What services EJB containers provide to Session beans?
Please choose all the answers that apply:
a) Caching and pooling
b) EJB life cycle management
c) HTTP requests management
d) RMI services

Q5.Where can the initial number of instances of session beans to be pooled in EJB container specified?
Please choose only one answer:
a) the number is specified using EJB3 annotaion
b) the number is specified in web.xml configuration file
c) the number is specified in the external deployment descriptor

Q6.Which is not part of EJB 3.0?
a. Session Beans
b. Entity Beans
c. MessageDriven Beans
d. All of the above

Q7.What is default EJB version in J2EE 5 ?
a) EJB 2.0
b) EJB 2.1
c) EJB 3.0
d) EJB 3.1

Q8.Which services provide by the container?
a) Persistence
b) Transaction
c) Security
d) Life Cycle Management
e) All of the above

Q9.Which is used for @Stateful annotation?
a) javax.ejb.Stateful
b) java.ejb.Stateful
c) javax.ejbx.Stateful
d) javax.ejb.StateFul

Q10.Which of the following is listed in the advantages of EJB 3.0
a) Fewer number of classes and interfaces
b) POJO/POJI-based components (Plain old java objects and plain old java interfaces)
c) Deployment descriptors are optional
d) JNDI(Java naming and directory Interface) lookups are no longer necessary
e) all of the above

Q11.Which of the following options describes about a session bean
a) @Entity
b) @Session
c) @Stateless
d) @MessageDriven

Q12.Which of the following is not referred as a life cycle event handlers for creating session bean?
a) @PostConstruct
b) @PreDestroy
c) @PrePassivate
d) @PostActivate
e) @Interceptor

Q13.Which statement about life-cycle callback methods is correct?
a) Life-cycle callback methods must be implemented in the bean class.
b) Life-cycle callback methods can have public, private, protected, or package-level access
c) A life-cycle callback method can only have a single callback annotation.
d) In other words, you cannot define a single method and give it two different callback annotations
e) Life-cycle callback methods can be declared as static

Q14.Which of the following statements is true about stateless session bean?
a) The bean class must implement serializable
b) It is legal for stateless session beans to use bean-managed transaction
c) Stateless session bean instances store client-specific state across invocations
d) Stateless Session bean instance must implement the javax.ejb.SessionSynchronisation interface


Q15.Which statement characterizes stateless session beans?
a) They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks
b) They require home interfaces
c) When a client looks up a stateful session bean in the JNDI, the same bean is returned every time.
d) They are asynchronous message consumers

You might also like