I am having a hard time understanding SFSBs. I would like to maintain state in the
EJB tier, but it doesn't seem to work that way when the browser is the ejb client. It looks like I have to create a SFSB and store a reference of that in the HTTPSession - is that correct?
For example, with the typical shopping cart example, a user adds a product to his cart. Then, jumps around the site to different pages and decides to add another product. This action should add a product to the same instance of Cart object that he used previously. I can only get this to work if I store a reference to the one SFSB instance in the HTTPSession.
If I don't do it this way, and instead get the SFSB by calling ejbCreate() each time a product is added to the cart, it gives me a newly instantiated Cart object. In other words, It doesn't contain the products that was added earlier...
I am totally confused because books/articles talk about using HTTPSession vs. SFSB for this purpose --- but they appear to me to serve different purposes entirely.
So, is using the HTTPSession to store the SFSB reference the only way to maintain ejb state across multiple page navigations (e.g. http requests).