1.Well did you maintain state in DB, Server memory, like the EJBContext, and did you pass some context Id across to the client in response to every request from the client?
2. Why did you opt for using Stateless beans to maintain state and not continue using the right Stateful session beans?
C Shinde wrote:Has anyone used a Stateless Session bean as a Stateful Session beans with EJB 2.1 Spec?
Yes, a lot many applications use those.
OK, I am not fully awake yet! I read that question as "Has anyone used a Stateless Session bean and a Stateful Session beans with EJB2.1 spec?"
To answer your original question - No, using stateless session bean as a stateful session bean is not going to work out. If the application needs to maintain a state in the beans, then go for Stateful session beans. Any reason why you are trying to use SLSB when the usecase demands SFSB?
Joined: Oct 22, 2009
We surely have used Session beans to do Entity bean 'DB select' kind of activity with EJB 2.0. I dont remember if we had used stateful or stateless beans in this scenario and thats why the question came up.
I dont have any requirements, its just a question that came to my mind. An interview kind of an question say!