IntelliJ Java IDE
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes HttpSession vs Stateful Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Architect Certification (SCEA/OCMJEA)
Reply Bookmark "HttpSession vs Stateful Session Bean" Watch "HttpSession vs Stateful Session Bean" New topic
Author

HttpSession vs Stateful Session Bean

Kartik Shah
Ranch Hand

Joined: Dec 07, 2000
Posts: 102
What are the criteria for choosing between HttpSession and Stateful Session Bean ?


Kartik Shah
SCJP, SCDJWS, IBM Certified Websphere & XML, PMP & Six Sigma - http://blog.kartikshah.info
Nicky Moelholm
Ranch Hand

Joined: Jan 20, 2002
Posts: 43
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.


Nicky Moelholm
MyCerts: SCJP 1.2, SCJP 1.5, SCJD, SCWCD 1.3, SCBCD 1.3, SCDJWS 1.4, SCEA, IBM 253
MyBooks: IBM WebSphere Application Server V7.0 Web Services Guide
Mon Mayor
Ranch Hand

Joined: Mar 07, 2002
Posts: 40
Use Stateful Session beans
1. for sharing session across multiple applications
2. for maintaining transactional state
3. for application clients
Emil Kirschner
Greenhorn

Joined: Jul 10, 2002
Posts: 10
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

Joined: Feb 21, 2002
Posts: 313
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,


Byron Estes<br />Sun Certified Enterprise Architect<br />Senior Consulant<br />Blackwell Consulting Services<br />Chicago, IL<br /><a href="http://www.bcsinc.com" target="_blank" rel="nofollow">www.bcsinc.com</a>
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1825
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
 
 
subject: HttpSession vs Stateful Session Bean
 
Threads others viewed
http session object,ejb session bean
httpsession objects and stateful session beans
isIdentical
Diff between HttpSession and Stateful Session bean
Amusing...
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture