How to restore session after application restart

Hello,

we as a company use continuous deployment for one of our vaadin tools. After every deploy the user sessions expire. Is it possible to restore the session without reloading the UI window? Since the application is used by several people reloading the window after an expired session is not wanted.

Upgrading a live session would be very tricky as code changes might or might not be compatible with the data stored in the session.

What I think would be the best way of handling this is to have a server setup where all new sessions would use the new version and leave the old sessions to complete with old version. How to do this in practice depends on your production deploument setup.

Well i have done this. And this is
painfull
. You need a session replication, so if you got one instance of you application you need a infinispan (or whatever which you application server can use as a session storage) cluster setted up. If you have multiple instances of your application its enought just configure replicated cache for web session and do rolling updates, replacing instances one by one so a new one take over replicated cache, by doing this you need some event which indicates that cache is successfully transfered. If you are not using some orchestration tools like openshift or docker swarm it will double you pain because then you need to control you proxies your self to avoid new clients on maked for deletion instance.

By all this you should not forge a split brain situations and and and…

PS or if you have one instance of you application you can try to store serialized sessions into database then after restart client can keep using application. In conjuction with Green/Blue deployments you can achive zero down time for you clients.