Configure JPA/Hibernate second level cache replication mode in EAP 6

Solution Unverified - Updated -

Issue

  • Is it possible to have a replicated 2nd level cache in a cluster for JPA entities and how to configure it?
  • I have a persistence.xml as followed to have the entities cached, but I want this cache replicated
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
    <persistence-unit name="EJB3JPAunit">
        <jta-data-source>java:/jboss/datasources/ExampleDS</jta-data-source>
        <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
        <properties>
            <property name="hibernate.hbm2ddl.auto" value="update" ></property>
            <property name="hibernate.cache.use_second_level_cache" value="true"></property>
        </properties>
    </persistence-unit>
</persistence>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.