Greg Jacobi wrote:
> Is there an easy way to share "HttpSession objects" (or any other
> object for that
> matter) accross many servlet servers? The situation is one where we
> have a server
> cluster, and I would like to be able to create a session on one machine
> and have
> it available to users hitting on another machine. I would hate to have
> to rely on
> one single machine to maintain state.
>
It is legal for a servlet engine to do this, as long as the distributed
servlet servers are all part of the same servlet context (which would
typically be the case for a single application). However, the support for
migrating session data back and forth has to be built in to the servlet
engine.
Doing just the basic stuff (which session IDs are valid, when they were
last accessed, and so on) is pretty easy. Coping with changes in the user
data objects you store with HttpSession.putValue() is a lot more
challenging. Apache JServ doesn't have this functionality, but I
understand that some servlet engines make some attempts to deal with it.
>
> Can the servlet archtiecture handle this or should I be dealing with
> this problem
> myself, inside the application?
>
> Thanks,
> Greg
>
Apache JServ has some "experimental" load balancing code that deals with
distributed servlet engines quite nicely. The way it deals with sessions
is that a particular session ID is always sent back to the host that
created it, but new session creations are randomly distributed (which you
can affect with weighting parameters) between the available servers. This
might or might not be sufficient to deal with your application, but it
should be worth checking out.
See the documentation on Load Balancing in the download, and on the
http://java.apache.org web site.
Craig McClanahan
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]