This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.
Could you help me earliest.
Joined: Nov 15, 2004
I tried as you said,
I closed the first bean and created new one but the new bean is retaining the previous values of first bean.
Note: i am using same home refferencing.