7. Which statement characterizes stateful session beans? Select only one 1) They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks. 2) They require home interfaces. 3) When a client looks up a stateful session bean in the JNDI, the same bean is returned every time. 4) They are asynchronous message consumers.
Correct answer is 1. I agree that 1 is a correct, but can someone explain me why 3 is incorrect
Stateful session beans are not pooled. A new session bean will be instantiated for each client requesting it from JNDI. It would not be useful if a client could not instantiate two different stateful session beans of the same class, would it ?
I think the option refers to the identity of ejb's in the client view. That is compared with "equals" [e.g. ejb1.equals(ejb2) ] and says wether two ejb's are meaningfully (!) identical. If you lookup two stateless session beans of the same type, they are allways "equal", while stateful session beans are never. [ November 19, 2008: Message edited by: Ralph Jaus ]