Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTPSession Vs Statefull Session Bean

 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we go for Statefull Session Bean instead of HTTPSession ?
 
Ajith George
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually they are entirely different. We use statefulle session ejb's when we want to store any kind of sate temperorly. This will have scope same to the scope of the object of that bean. But HTTPSession is having scope only on each session id made by the client. Moreover data carrying capability is limited. If you store too much data on Httpsesion, your application definitly will become slow.

Hope this will give you some better idea
 
Sergio Berna
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As i see it they are both different things. You use httpSessions to store temporary data between page calls and you use an stateful ejb bean to use ejb beans that need some kind of state.

I would not join them both together by inserting the remote interface into the http session. You are bound to have a lot of problems with clustering and you would be limited to in memory session representation. If you need to store something for the session duration i would go for entity ejb and would only store the reference to the ejb pkid into the session.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic