keepstate, keepSessions, keep-state, save-sessions-enabled in GlassFish 3.1
GlassFish supports the preseving of HTTP session data across the redeployment of web application.
Prior to GlassFish 3.1, one can achieve this through the command line as follows:
asadmin redeploy <b>--properties keepSessions=true</b> --name ${APP_NAME} ${A_WAR}
In GlassFish 3.1, web sessions, Stateful Session EJB instances and persistently created EJB timers can be retained between redeployments. A new option is introduced as follows:
asadmin redeploy <b>--keepstate=true</b> --name ${APP_NAME} ${A_WAR}
In addition, one also supports the preseving of HTTP session data through the deployment descriptor in glassfish-web.xml as follows:
<glassfish-web-app>
<keep-state>true<keep-state>
<glassfish-web-app>
As an alternative, one can use weblogic.xml as follows:
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<container-descriptor>
<save-sessions-enabled>true<save-sessions-enabled>
<container-descriptor>
<weblogic-web-app>
In this case, the command options override the deployment descriptor. And as usual one will ignore the presence of weblogic.xml if there is a glassfish-web.xml. Hence, for HTTP session data, we have the following precedence:
<i>--keepstate</i> <b style="font-size: 170%;">></b> <i>--properties keepSessions</i> <b style="font-size: 170%;">></b> <i><keep-state></i> <b style="font-size: 170%;">></b> <i><save-sessions-enabled></i>
- Login or register to post comments
- Printer-friendly version
- swchan2's blog
- 1310 reads





