Hi, I am having some basic doubts on session beans, please clarify them ( I know they are very silly for you)
1. What will happen if the user calls remove() method on stateless session bean ?
2. What will happen if the user is not calling any of the methods for long time, when the statefull session bean is in method ready state. ==> My understanding is - If the method is in the transaction and the user is not interacting for the specified time( defined by the container), then ejbRemove() method is called and the bean moves to 'does not exist' state. If the method is not in the trasaction, first the bean is moved to passivate state and even after moving to the passivate state user is not calling any methods, then the bean is moved to 'does not exist' state, with out calling, ejbRemove() method - Is this correct or not? If it is not, then please correct me
3. How can we get the transaction reference in ejbPassivate()/ejbActivate() methods -- Bec, ejbPassivate() is called only if the bean is not in the transaction. Now, if the bean is not in the transaction, how will you get the transaction references???
4. In setSeesingContext(), why can't i get the reference to the EJBObject()? Bec, EJB Object is created before creating the session context.
5. Will ejbRemove() is called, if user calles the remove() method and the bean is already passivated, i.e. bean is in passivated state.
1) The container ignores the remove request 2) The bean will NEVER be passivated or removed if it is in a transaction, no matter how long it has been since the client called a method. The container might call ejbRemove first, instead of calling ejbPassivate. You're right, if the bean is passivated, the container will not call ejbRemove.