Stateful bean not keeping state?
Hi. I am fairly new to EJB's and as an example initial project I was wanting to create a car builder. At the moment, its very simple as I have an enterprise project, with two sub-projects being the client and ejb module. In my EJB module I have two classes which is one for the business interface, and the other for my EJB. I have declared the EJB @Stateful and it has several methods such as addComponent(String sComponent), removeComponent( etc...
For the client I have a JSF simple form with a text box and a button to add a component to the list and refresh the page. This all works fine, except when I run the project it adds the component, but each time the page has been refreshed the EJB re-initializes and loses state while only ever displaying the last item i'm adding. Have I not quite got the hang of how EJB's work? Are they just solely for keeping state while the page is not affected, and are best suited for one time calls? I can use a local managed bean to store the components between page refreshes, but am just wondering if there is any way to store data remotely using EJB's. It's fine if thats not how they work, just interested :)
Thanks in advance.