Session attribute lost issue with the ATTRIBUTE replication-granularity + non-BATCH cache in a failover scenario in JBoss EAP 7
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
Issue
-
Session attributes lost issue happens with the configuration using the ATTRIBUTE replication-granularity + non-BATCH cache in a failover scenario in JBoss EAP 7.
-
A newly created session attribute after failover is lost in the subsequent
session.getAttribute()invocations during the same request processing. -
This issue happens When I have a web application which has the "ATTRIBUTE" replication granularity in
jboss-web.xml:<?xml version="1.0" encoding="UTF-8"?> <jboss-web version="7.1" xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/schema/jbossas/jboss-web_7_1.xsd"> <replication-config> <replication-granularity>ATTRIBUTE</replication-granularity> </replication-config> </jboss-web>and
<transaction mode="BATCH"/>is disabled for the "web" cache in infinispan subsystem like this knowledge article:<subsystem xmlns="urn:jboss:domain:infinispan:7.0"> ... <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan"> <transport lock-timeout="60000"/> <distributed-cache name="dist"> <!-- <locking isolation="REPEATABLE_READ"/> --> <!-- <transaction mode="BATCH"/> --> <file-store/> </distributed-cache> </cache-container> ... </subsystem>
Resolution
- This is a bug that has been reported as This content is not included.JBEAP-18927 for 7.2.x / This content is not included.JBEAP-18951 for 7.3.x and will be fixed in JBoss EAP 7.2.8 and EAP 7.3.1 or later.
- Until EAP 7.2.8 or EAP 7.3.1 are released, this issue can be workaround by either of the followings:
- Enable transactions on the
<distributed-cache>/<replicated-cache>. (e.g. revert back<transaction mode="BATCH"/>) - Use a non-transactional
<scattered-cache>instead of a non-transactional<distributed-cache>/<replicated-cache> - Use the
SESSIONreplication-granularity (i.e.<replication-granularity>SESSION</replication-granularity>injboss-web.xml) instead of theATTRIBUTEreplication-granularity
- Enable transactions on the
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.