2. Configure the Infinispan subsystem with an Infinispan invalidation-cache that uses a shared, persistent jdbc-store that references your DataSource (by its pool-name) from step 1.
e.g.
<!-- ... -->
<jdbc-store data-source="MSSQL" dialect="SQL_SERVER" shared="true" passivation="false" purge="false"/>
</cache-container>
3. Configure your web application to use the cache from step 2. You can achieve this in 1 of 4 ways:
a. Within the Infinispan subsystem, change the default cache of the web cache container to the cache you created in step 2.
e.g.
<cache-container name="web" default-cache="foo">...</cache-container>
b. Within the distributable-web subsystem, modify the default session-management profile to use the cache defined in step 2.
e.g.
<subsystem xmlns="urn:jboss:domain:distributable-web:3.0" default-session-management="bar" ...>
<infinispan-session-management name="bar" cache-container="web" cache="foo" granularity="ATTRIBUTE">
<primary-owner-affinity/>
</infinispan-session-management>
<!-- ... -->
</subsytem>
c. Within the distributable-web subsystem, create a new session-management profile referencing the cache you created in step 2, and configure your web application to use it.
e.g.
<subsystem xmlns="urn:jboss:domain:distributable-web:3.0" default-session-management="default" ...>
<infinispan-session-management name="bar" cache-container="web" cache="foo" granularity="ATTRIBUTE">
<primary-owner-affinity/>
</infinispan-session-management>
<!-- ... -->
</subsytem>
/WEB-INF/distributable-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<distributable-web xmlns="urn:jboss:distributable-web:2.0">
<session-management name="bar"/>
</distributable-web>
d. Configure an application-specific session-mangement profile, configured to use the cache defined in step 2.
e.g.
/WEB-INF/distributable-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<distributable-web xmlns="urn:jboss:distributable-web:2.0">
<infinispan-session-management cache-container="web" cache="foo" granularity="ATTRIBUTE">
<primary-owner-affinity/>
</infinispan-session-management>
</distributable-web>
4. Make sure your web application is distributable, e.g.
/WEB-INF/web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="...">
<distributable/>
<!--- ... -->
</web-app>
Let me know if you have additional questions.
Paul