0



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."

  • Is it true that Stateful ejb is a good choice for non http client, so http session like state can be managed on the server.
  • Ashish
    • 198
    • 3
    • 11
    • There are all the answers to your questions in the Java EE documentation from Oracle. – The Bitman May 02 '17 at 13:01
    • Hi @TheBitman the Oracle documentation does't say anything about the difference in httpsession and ejb session and is also very theoretical, does't give any examples. If things were clear from Oracle documentation then I would never buy any JEE book or watch any JEE video. – Ashish May 02 '17 at 14:20
    • @BalusC yes this is useful. – Ashish May 02 '17 at 14:21

    0 Answers0