Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Sessions  RSS feed

 
Murtaza Husain
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks!

This one is a simple one. I hope anyone of you give me the answer.

Well I want to know the difference between EJB Session and http Session.
Specially when we are accessing restricted EJB session beans through a http session which has validated us which session we are actually in.

Thanks in advance!
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A bad choice of names.

EJBs come in two primary flavors (or at least they did until about EJB 2.0): Entity beans, which are intended to aid in the management of data, and Session beans, which are intended to be repositories for logic (think Windows DLLs, for example).

Http Sessions, on the other hand, are a mechanism for maintaining continuity (state) while operating under a stateless protocol (HTTP).

The only real overlap is that a Stateful Session EJB can hold onto information spanning multiple HTTP requests just like the HTTP session can. However the App server automatically tracks the HTTP session. The only way to keep a handle on a SS EJB is to explicitly look it up on each HTTP request or to store a handle to it in the HTTP session. And when I say "explicitly look up", I mean above and beyond the basic locator function, since that simply returns a SS EJB, not necessarily the one you were using on the last HTTP request.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!