Hi,
I am implementing session replication in JBoss 7.4 . I have achieved it using the <distrubuted-cache> for web cache containers ( module="org.wildfly.clustering.web.infinispan"). But, I have a requirement where I need to achieve this using Database, i.e. storing user session data in DB instead of in-memory. I have gone through multiple articles but none of them worked.
Following I have already tried.
Number1: While using this, I get the error in JBoss stating that I cannot user attribute tag inside local-cache element.
<cache-container name="web" default-cache="database" modules="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<replicated-cache name="repl">
<file-store/>
</replicated-cache>
<replicated-cache name="sso">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
</replicated-cache>
<replicated-cache name="routing"/>
<distributed-cache name="dist">
<file-store/>
</distributed-cache>
<local-cache name="database">
<attributes>
<attribute name="transactionMode">OPTIMISTIC</attribute>
<attribute name="transactionManager">default</attribute>
<attribute name="isolationLevel">READ_COMMITTED</attribute>
<attribute name="statistics">true</attribute>
<attribute name="shared">true</attribute>
<attribute name="persistence">
<attribute name="store">jdbc</attribute>
<attribute name="dataSource">java:/MyDataSource</attribute>
<attribute name="table">httpsessions</attribute>
<attribute name="idColumn">id</attribute>
<attribute name="dataColumn">data</attribute>
<attribute name="creationTimeColumn">creationtime</attribute>
<attribute name="lastAccessTimeColumn">lastaccess</attribute>
<attribute name="maxInactiveTimeColumn">maxinactive</attribute>
<attribute name="versionColumn">version</attribute>
</attribute>
</attributes>
</local-cache>
</cache-container>
<distributed-cache>
<persistence>
<jdbc:string-keyed-jdbc-store>
<!-- Specifies the JNDI name of a managed datasource on Infinispan Server. -->
<jdbc:data-source jndi-url="jdbc/postgres"/>
<jdbc:string-keyed-table drop-on-exit="true" create-on-start="true" prefix="TBL">
<jdbc:id-column name="ID" type="VARCHAR(255)"/>
<jdbc:data-column name="DATA" type="BYTEA"/>
<jdbc:timestamp-column name="TS" type="BIGINT"/>
<jdbc:segment-column name="S" type="INT"/>
</jdbc:string-keyed-table>
</jdbc:string-keyed-jdbc-store>
</persistence>
</distributed-cache>
Can someone please suggest if something is wrong/missing?