Ejb(Engineering > Computer Science And Engineering ) Questions and Answers
Question 1. Choose different kinds of enterprise beans in EJB from following
Session beans
Entity beans
Message-driven beans
All of the above
Explanation:-
Answer: Option D. -> All of the above
Question 2. remove() method of the Entity bean?
Remove the row of table from the database
Remove the instance from pool
Delete the TABLE from the database
None of the above
Explanation:-
Answer: Option B. -> Remove the instance from pool
Question 3. At what point, precisely, in the life-cycle is a container-managed entity bean considered created?
Immediately prior to the execution of its ejbCreate() method
Immediately after the execution of its ejbCreate() method
After the CMP bean's data has been committed to the underlying persistent datastore
During the execution of its ejbPostCreate() method
Explanation:-
Answer: Option B. -> Immediately after the execution of its ejbCreate() method
Question 4. Which middleware services are provided by EJB?
Security
Transaction Management
Both A & B
None of the above
Explanation:-
Answer: Option C. -> Both A & B
Question 5. For remote objects Java passes objects:
By reference
By object copy
By producing a serialized copy
B and C are correct
Explanation:-
Answer: Option D. -> B and C are correct
Question 6. Which of the following annotation is used to specify or inject a dependency as ejb instance into another ejb?
javax.ejb.Stateless
javax.ejb.Stateful
javax.ejb.MessageDrivenBean
javax.ejb.EJB
Explanation:-
Answer: Option D. -> javax.ejb.EJB
Question 7. The EJB specification architecture does NOT define
transactional components
client side security and encryption
distributed object components
server-side components
Explanation:-
Answer: Option B. -> client side security and encryption
Question 8. Which statement about session beans is true?
In both stateless and statefull session classes, the bean provider must write the method public void remove()
The method > in the component interface can be accessed only by the remote clients
The bean's handle must be provided by the client, in order to ask the EJBHome for removing a session bean
None of the above
Explanation:-
Answer: Option C. -> The bean's handle must be provided by the client, in order to ask the EJBHome for removing a session bean
Question 9. Which of the following is true?
Preserving of any state across method calls does not performed by Stateless session beans
Multiple users can access Stateful session beans at the same time
Both are correct
None
Explanation:-
Answer: Option A. -> Preserving of any state across method calls does not performed by Stateless session beans
Question 10. Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?