I have an application which changes the state of user sessions in lots of places in the code. Is it possible to do a seamless switch of Tomcat servers, preserving all sessions?
I know I can use PersistentManager to persist sessions and load them. I can think of two strategies: 1. Persist sessions periodically. This is more robust as I might not have control of when the server shuts down. 2. Persist sessions on server shutdown. The problem with the first approach is that I might lose the latest changes when the new server comes up. The problem with the second is that I'll have to lock access to the session until the old server is done saving it, which may make response times very slow. Is there a good solution to this that I might have overlooked?