Persistent-store

From CauchoWiki

Jump to: navigation, search


The <persistent-store> configures persistent storage for distributed objects like sessions. The session-config must have a <use-persistent-store/> to use the store.

tagdescriptiondefault
typefile, jdbc, or clusterrequired
init|persistent-store specific configuration

Contents

[edit] 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.

tagdescriptiondefault
paththe path to the persistence directoryrequired

[edit] type="jdbc"

The jdbc store uses a database server to persist the sessions. Requires Resin Professional.

tagdescriptiondefault
data-sourcea configured <database>required

[edit] 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.

tagdescriptiondefault
patha directory where the sessions will be storedrequired
triplicatestores sessions on two backup serverstrue (3.0.20 and later)

[edit] 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>
Personal tools