1
votes

I have one webapp on one Tomcat 7 (7.0.28) server. I would like to use the built in parallel deployment feature of Tomcat (FOO##001.war, FOO##002.war, etc) but I can't have users stay on the old version until their session times out or is otherwise invalidated. I also can't just invalidate their session on the older webapp and make them log in again on the new webapp. I've looked into clustering tomcat servers but again, I only have the one Tomcat instance.

Is there a simple way using my existing setup without changing too much (or anything, preferably) to migrate sessions automatically from the old version to the new version, without invalidating sessions or booting users from the webapp?

1

1 Answers

0
votes

After much research and frustration, the answer, it turns out, is that what I wanted to achieve is simply not possible with Tomcat -- at least not in the way I had hoped. The solution I finally came up with was to use a memcached session manager instead of the default Tomcat serialization strategy. This allowed sessions to remain active external to Tomcat and also for them to be shared across several webapps running in the same Tomcat container.

However, this created another problem, because now the same session was valid for two instances of the same webapp (of different versions). Tomcat doens't know how to handle this situation, since both old version and new version of the app are at the same address, and rather than pick an instance, Tomcat does nothing and displays a blank page. The solution to this was somewhat hacky - I modified our Ant deploy script to simultaneously deploy the new versioned webapp and undeploy the old versioned webapp.

This results in a completely seamless deployment of the app, with no impact on end users.