On Wed, 28 Mar 2001, Kurt Olsen wrote:

> It's been my impression that the bigger servers can maintain session across
> webservers. I thought that when something was stuck in the session that it
> must be Serializable and when session.setAttribute(x,y) was called that the
> object was stashed somewhere, such as a ldap or database and keyed by
> session id.
> 

>From the point of view of your application, the servlet spec requires you
to do the following to run in a load-balanced server:

* Add a <distributable/> element to your web.xml file in the appropriate
  place.

* Ensure that any session attribute you create implements Serializable.

Some application servers impose an additional (non-spec) requirement that
servlet context attributes must be Serializable as well.

The requirement on the servlet container is that, at any point in time,
all requests for the same session be handled inside the same JVM.  Thus,
your application level classes generally do not have to do anything
special other than the above requirements.

> At least I'm praying that something like this works when/if we get our app
> to the server farm size.

The details of whether and how this works depends very much on the
application server you are running on.  None of the rules are really
specific to Struts -- they would affect any and all web apps run on that
server.  Check your server's docs on distributable applications for more
info.

> Kurt
> 

Craig McClanahan

Reply via email to