I am developing an eCommerce application. For that I want to create a session for each customer to maintain their cart information.
If it is a normal Java EE Project I would have used HttpSession session = request.getSession(); and add all the cart information to that session.
My question is for an EJB project, what is the procedure to create a session for the above mentioned purpose?
EJB is nothing but a Business logic running independently in a same/separated location
It does not know, who is invoking the logic. In that case, the word session will not fit here.
You can call it in a different manner as Maintaining the state of an EJB Session bean with the use of Stateful session bean
It is nothing but a session bean with instance variables. On receiving the instance, you can assign a value of an attribute in the bean
This is usually used in Online shopping, where the transaction has to be traced and maintained