After doing some research I realised that http session and ejb session are two different things or in other words @SessionScoped (cdi) and @Stateful are two different scopes.
Now for http session I know how session is created, how browser sends the sessionId to be associated with a particular session and how the session is terminated.
However I don't understand this whole flow in ejb environment.
- Who is the ejb client, is it a browser or what?
- When/How an ejb session is created ?
- How a client is associated with a particular ejb session ?
- When/How an ejb session is terminated ?
Any code example that can demonstrate answers of above questions will be great.
I read this article which says (quoting from the article):
"Basically, if you are working with a client that does not have access to the HTTP protocol that allows state to be managed through an HttpSession, then stateful session beans are a good choice."