Forums Register Login

Diff between HttpSession and Stateful Session bean

+Pie Number of slices to send: Send
What is the difference between using a HttpSession & a Stateful
Session bean ? Why can't HttpSession be used instead of Session bean
+Pie Number of slices to send: Send
Hi Sitaram,


Why can't HttpSession be used instead of Session bean


If your app needs to support RMI clients then obviously you cannot use the HttpSession and SFSBs might be an acceptable solution.


What is the difference between using a HttpSession & a Stateful
Session bean ?


They were both design to do the same, but HttpSession is for web applications a better choice. One reason behind this is that the container can optimize the way the HttpSession data is replicated across the cluster, in a better way than SFSB data. The algorithm is very simple: with HttpSessions the container knows what data got changed, tracing the setAttribute calls. Hence when is about replicating the information to other servers in the cluster the container won�t replicate the whole HttpSession data, but only the changed data. As for SFSB the container has no way to figure out which data was change and the whole session information get replicated any time it changes.
Regards.
Everyone is a villain in someone else's story. Especially this devious tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1463 times.
Similar Threads
Amusing...
Session Bean
HttpSession vs Stateful Session Bean
httpsession objects and stateful session beans
http session object,ejb session bean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:09:20.