To enable session persistence to a database:
1. Configure your datasource. See https://community.jboss.org/wiki/DataSourceConfigurationInAS7
2. Assuming you're using a non-HA profile (e.g. standalone.xml), add a "web" cache container to the infinispan subsystem. The default cache of this cache container should be a local-cache configured with a jdbc cache store using the datasource defined in step 1.
e.g.
{code:xml}
<cache-container name="web" default-cache="local" module="org.jboss.as.clustering.web.infinispan">
<local-cache name="local" batching="true">
<key-based-jdbc-store datasource="java:jboss/datasources/LiferayPool_test" passivation="false" purge="false"/>
</replicated-cache>
</cache-container>
{code}
3. Make sure your web application's web.xml declares itself as <distributable/>.