[jboss-user] [Clustering] - HTTP Session passivation - How to survive server restarts?

RichardTaylor do-not-reply at jboss.com
Mon Oct 12 13:46:28 EDT 2009

Note: 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: 

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: 
anonymous wrote : 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 
  | 	<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?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4259929#4259929

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4259929

More information about the jboss-user mailing list