In Stateless session why do we need to implement ejbActivate(), and ejbPassivate() methods since its empty and doesnt maintain any state behalf of a client ? Because, when you implement a session bean, your code doesn't care whether is stateless or stateful, you just implement the SessionBean interface when you write your bean.
Now, if you look at the
SessionBean interface you see that these two methods are declared there, so you must implement them, even if you put nothing in them (for stateless session bean.
In Statefull Session Bean how cotainer maintain a conversational state for a client ? can any one explain briefly how it does ? thru passivation and activation. your bean is tied to a particular client, and will maintain its state by using these two methods and storing your instance (serializable) variables in a persistent storage, to keep resources and to wait until the client requests another business method.
how to identify a bean is a stateless or statefull programmatically instead of deployment descripter ? Did you mean that if you look at a bean code, how can you say whether it's statless or stateful?
hmm, stateless session beans have only a single ejbCreate() method, that takes
no parameters. This is because stateless are *not* tied to any client.
Stateful session beans can have multiple overloaded ejbCreate() methods.
passivate/activate wouldn't do it, since you can put code in your stateless methods if you want, it just not going to be executed.
hope it helps