Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

HttpSession vs Stateful Session Bean

 
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 ?
 
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.
 
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
 
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.
 
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,
 
Ranch Hand
Posts: 1871
  • 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
 
I don't even know how to spell CIA. But this tiny ad does:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!