This is complementary to my other question, I don't understand how "scoping" works is in Java-EE. In fact the terminology such as "scope" and "session" used regarding EJB's and CBI seems to be completely confused.
But ignoring the confusing terms, what actually happens ? For example let's say we have a servlet in the web tier. We might want to have a stateful EJB to keep information either for 1) an entire HTTP session consisting of back and forth requests 2) a single HTTP request, though the EJB methods may be called multiple times by the servlet for the same request, so we still need a stateful bean to hold state between the multiple calls to it despite only having one HTTP request. And so on with the other types...
My question is, CDI seems to provide these options, however prior to CDI, and now if not using CDI, how did/do EJB's handle the difference between a session scope and a request scope? The term session beans seem to be misleading as they do not seem to refer to http session. In fact it seems like "stateful" is what actually could be tied to an http session.
If I understand correctly the CDI container keeps track of an HTTP session by using cookies or other fallback methods and that is how it is able to know when to destroy session scope beans, does the EJB container also keep track of the http session ? Or do they both use the same plumbing to keep track of the session ? Any insights are greatly appreciated into this highly confusing area,
Thanks