We are designing a web application that will use JBoss as application server and Tomcat as a web server. Eventually, we expect to be running the application on several web servers and application servers, so the architecture has to be scalable.
- Posted by: Peter Seller
- Posted on: February 11 2003 17:08 EST
For those operations that require the preservation of a conversational state, we'd like to use stateful session beans on the application server rather than HttpSessions on the web server. This way, there's no problem sharing sessions across web servers when another web server is added, since it would not matter on which web server a client request is served.
Yet, how the web client (servlets/JSPs) would keep using the same stateful session bean between request ? Do we need still to use HttpSessions to keep a reference to the appropriate stateful session bean ? In this case, do we still have to address the issue of HttpSession sharing across web servers ?
Any help would be greatly appreciated. Thanks !!
- Session in web server or application server ? by Rob Misek on February 12 2003 09:39 EST
- Session in web server or application server ? by Dave C on February 12 2003 15:42 EST
- shared session in web server with javagroups by Calin Medianu on February 14 2003 03:43 EST
Take a look at Tangosol's Coherence
product. It will allow you to share data across a cluster easily, coherently and synchronously. We also have an HTTPSession Replication Module which leverages our Replicated cache and cluster-wide locking capabilities to maintain the state of you HTTPSession across the cluster and provide immediate and reliable failover of session data.
Coherence: Easily share live data across a cluster!
I would guess that you would still need to keep a hold of the reference to the stateful session bean, and thus, you'd need to keep your HttpSessions synchronized.
However, you may be able to architect your load balancing such that the server serving the first request of a particular client services all requests of that particular client. Thus, you could avoid HttpSession sync'ing, because you'd know that a given client will always be served by the same JVM.
This may require special hardware/software as well....
I think you are right. We'll need to have some way of keeping the HttpSessions synch, shared, or something. Since we are using JBoss, I believe that session sharing is part of their 'clustering' feature.
Thanks for you comments,
have a look at this article:
javagroups seems to do sharing of HTTP sessions that contain little data accross multiple tomcat servers, so you could share the reference to the session bean.