Hello everyone,
Could you please help me with the following.
How do I make sure that all my Stateless Session
EJB's that are willing to save/retreive something from the Stateful Session EJB ("shopping cart") make sure that they get indeed always the same bean instance of that shopping cart EJB?
Does it happen automatically whenever I invoke create() method of the shopping cart bean? Does container guarantee that I always get the same instance? If not, what is the correct way to do this?
Of course a workaround for this situation would be to always return the output of the SLSB's to the controller and then store in on the shopping cart from the controller (controller maintains the stub of the SFSB. On the other hand, SLSBs expire after every call, thus storing the reference to the shopping card in the SLSB makes no sense. This solution would involve extra remote calls, thus not good for performance.
Thanks in advance for all replies.