[jboss-user] [JBoss Cache Users] - HTTP Session passivation during server restart?

RichardTaylor do-not-reply at jboss.com
Fri Oct 9 10:54:47 EDT 2009


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

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

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



More information about the jboss-user mailing list