HTTP Session passivation - How to survive server restarts?
triumphthepup Oct 12, 2009 1:46 PMNote: It was suggested that I move this post to this forum from JBoss Cache Users (the original post was here: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=162299 No content there)
I'd like to enable HTTP Session passivation so that all active sessions are passivated to disk during a graceful server restart. I'd like users to stay logged in through a server restart (single server). This is especially helpful in a development environment.
JBoss 5.1.0
JBoss Cache 3.2.1
I've read the following and have followed the instructions:
http://www.jboss.org/community/wiki/HttpSessionPassivationDesign
http://www.jboss.org/community/wiki/DistributableHttpSessionPassivation
Session passivation works in the sense that when my specified time limits are hit, sessions are written to disk. However when I gracefully shut down the server, all passivated sessions are deleted from disk.
In the section describing passivation being triggered by a server shutdown it says:
If the session is valid, then it's passivated to allow for reconstruction of the session
This implies either that my sessions are being considered invalid, a configuration issue, or possibly a bug. My HTTP session timeout is 20 minutes, so I should be fine in that regard.
Relevant configuration:
From our jboss-web.xml
<passivation-config> <use-session-passivation>true</use-session-passivation> <passivation-min-idle-time>-1</passivation-min-idle-time> <passivation-max-idle-time>300</passivation-max-idle-time> </passivation-config>
From the http session cache section of jboss-cache-manager-jboss-beans:
<property name="cacheLoaderConfig"> <bean class="org.jboss.cache.config.CacheLoaderConfig"> <!-- Do not change these --> <property name="passivation">true</property> <property name="shared">false</property> <property name="individualCacheLoaderConfigs"> <list> <bean class="org.jboss.cache.loader.FileCacheLoaderConfig"> <!-- Where passivated sessions are stored --> <property name="location">${jboss.server.data.dir}${/}session2</property> <!-- Do not change these --> <property name="async">false</property> <property name="fetchPersistentState">true</property> <property name="purgeOnStartup">true</property> <property name="ignoreModifications">false</property> <property name="checkCharacterPortability">false</property> </bean> </list> </property> </bean> </property>
Is there a trick to getting this going? This should be possible, correct?