I have implemented a Stateless Session Bean, part of the code snippet is below.
My problem is when i call add() method on stateless session bean i trying to store the values in the global variables, so when i call different method on the same bean, the previous values which i stored in the session as global variables able to retain. How this is happening.? According the Stateless session bean behaviour it should not remember the values which i stored as part of my first call to my first method right?
I agree with this, if i close the existing bean and create new bean obviously its brand new bean eventually its not going to remember what previous state.
Lets say i have another stateful session bean. Suppose if i create first bean and called add() method and closed the bean. I have created new bean and called add() method, here you mean to say that this 2nd bean can remember that state of the previous bean.add().
I am worried how to see the difference between Stateless and Stateful practically.