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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content