The <persistent-store> configures persistent storage for distributed objects like sessions. The session-config must have a <use-persistent-store/> to use the store.
tag |
description |
default
|
type |
file, jdbc, or cluster |
required
|
init|persistent-store specific configuration |
|
type="file"
The file store is suitable only for single-server configurations which want to persist the session start over server restarts. It is useful for development servers, letting you keep sessions across web-app restarts.
tag |
description |
default
|
path |
the path to the persistence directory |
required
|
type="jdbc"
The jdbc store uses a database server to persist the sessions. Requires Resin Professional.
tag |
description |
default
|
data-source |
a configured <database> |
required
|
type="cluster"
Uses TCP connections to replicate sessions across the cluster. Requires Resin Professional. In 3.0.20 and later, the sessions are backed up onto two servers, meaning any two servers can go down without loss of session information.
tag |
description |
default
|
path |
a directory where the sessions will be stored |
required
|
triplicate |
stores sessions on two backup servers |
true (3.0.20 and later)
|
Example
<resin xmlns="http://caucho.com/ns/resin">
<server>
<cluster>
<srun server-id="a" port="6810"/>
<srun server-id="b" port="6811"/>
<srun server-id="c" port="6812"/>
</cluster>
<persistent-store type="cluster">
<init path="file:/tmp/caucho/qa/session"
triplicate="true"/>
</persistent-store>
<web-app-default>
<session-config use-persistent-store="true"/>
</web-app-default>
<host id=>
<web-app id='/'>
</web-app>
</host>
</server>
</resin>