aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes HTTPSession vs Stateful Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "HTTPSession vs Stateful Session Bean" Watch "HTTPSession vs Stateful Session Bean" New topic
Author

HTTPSession vs Stateful Session Bean

Bharat Talwar
Greenhorn

Joined: Jul 14, 2005
Posts: 9
Should I use HTTP Session or Stateful Session bean to maintain session information for the Part II assignment?
sankha subhra das
Greenhorn

Joined: Jun 24, 2003
Posts: 22
Bharat,
please read my earlier thread on this issue. Lemme know if it helps.
http://www.coderanch.com/t/152841/java-Architect-SCEA/certification/Hardware-inputs-architects

Thanks
Sankha Subhra Das
Bharat Talwar
Greenhorn

Joined: Jul 14, 2005
Posts: 9
Hi! Thanks for the reply. But my question has more to do with the performance as per the documents. Its says need bettr performance for travel agent application. If I use HTTP session (servlet) for both Web client and travel agent swing application, then how does the peformance differ? On the other hand, if I use SFSB for storing session then both can use it. Plus, Swing can call EJB directly thus reducing network traffic and improving performance. Pls advice?
sankha subhra das
Greenhorn

Joined: Jun 24, 2003
Posts: 22
Bharat,
precisely thats where u need to wear ur "architectural" cap and make a judicious choice. Yes travel agents will be the core of the business, hence the system should be fast/available to agents at all times.
You mentioned,
"If I use HTTP session (servlet) for both Web client and travel agent swing application, then how does the peformance differ?"
Take note first that http session can be used with web components only and NOT swing components. Now for the typical customer, you have a choice of using httpsession or SSB.There's plenty of articles on the internet discussing/comparing the two. As an architect, u need to think if httpsession will suffice for the amount of data to be stored in session. Also remember httpsession works best for storing small amounts of data like user navigation, preferences etc. I have used httpsession for my customer interface and provided justification for the same.
yes ur right when ur say that the use of SFSB will suffice both the actors' needs. Do u see any other choice than using swing components to talk to EJB's directly ? u might have ur own session management handling (like sending data back and forth between requests) or store it as a cache in agent's system. now u hafta figure out the performance impact between client side caching vis-a-vis server side caching thru SFSB's. again u hafta get back and see if the hardware provided will allow u this at the client without the need for extra caching servers. as a general rule, performance wise its faster for swing components to access business tier directly and web clients to use httpsession over SFSB's for most business processes.
As I said before, there is nothing wrong or right as far as architecture is concerned, it all depends on what assumptions u make and how best u fulfil the requirements given the hardware constraints.

Thanks
Sankha Subhra Das
Ajai
Ranch Hand

Joined: May 29, 2002
Posts: 198
Just to add.
I have read somewhere sometime back that SFSBs are not good in clustering environment .
Bharat Talwar
Greenhorn

Joined: Jul 14, 2005
Posts: 9
Thanks Sankha. It was helpful. I wanted to discuss some design choices in my current work area. Thought of discussing it with you if you interested. Kindly e-mail me at talwarbharat@yahoo.com, and i can take it offline.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HTTPSession vs Stateful Session Bean