JBoss 7.4 Session Replication

6 views
Skip to first unread message

Shubhankar Soni

unread,
Jun 4, 2024, 12:30:09 AMJun 4
to narayana-users
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>

Number2: After adding the below properties inside the web cache-container's distributed-cache. JBoss throws error stating persistence is not a valid element in distributed cache. (Source: https://infinispan.org/docs/stable/titles/configuring/configuring.html)

<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?



Tom Jenkinson

unread,
Jun 4, 2024, 4:51:26 AMJun 4
to Shubhankar Soni, narayana-users
Hi Shubhankar,

This is the community user group for the Narayana transaction manager and as I don't think it is a transactions question directly I think you have reached the wrong group for this type of discussion?

If you are using JBoss EAP then you should reach out directly to Red Hat by creating a support case.

Thank you,
Tom

--
You received this message because you are subscribed to the Google Groups "narayana-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to narayana-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/narayana-users/47bef5b3-9a6d-444c-b090-ec0590d573ean%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages