• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSession vs Stateful Session Bean

 
Kartik Shah
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the criteria for choosing between HttpSession and Stateful Session Bean ?
 
Nicky Moelholm
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you want better reuse of your user session handling you put it in the Stateful session bean. The latter makes it possible to use the logic from Swing clients etc.
 
Mon Mayor
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Stateful Session beans
1. for sharing session across multiple applications
2. for maintaining transactional state
3. for application clients
 
Emil Kirschner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicky Moelholm:
Hi,
If you want better reuse of your user session handling you put it in the Stateful session bean. The latter makes it possible to use the logic from Swing clients etc.

or from ejbs. you cannot access a http session maintained by a servlet from an EJB.
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An excellent point...
Using HTTPSession in any code relegates the object to only handling HTTP requests unless you put some sort of wrapper around it. A stateful session bean is independent of the underlying transport layer or protocol run on the transport layer. HTTPSession is more closely related to the presentation layer than the business layer and creates a limitation in the applicability of your design.
Regards,
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kartik,
Try out this download from JDJ which has an article relevant to the current topic under discussion
http://www.sys-con.com/weblogic/pdf/benefits.pdf
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic