Issue while configuring Hibernate 2nd level cache

Solution Verified - Updated -

Issue

  • After having migrated from JBoss 5.x to EAP 6.3.2 how to configure and check 2nd level cache.
  • We have some question to find out in persistence.xml file :
    • If there is a 2nd level cache configured or not ?
    • configure a 2nd level cache if not yet done and
    • check whether the 2nd level cache is working or not?
  • We are using persistence.xml and an entity bean annotated by @Cache.
  • When we insert :
<shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode>

into persistence.xml, the System will complains below:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'shared-cache-mode'. One of '{"http://
 java.sun.com/xml/ns/persistence":property}' is expected.
  • Will we want to Configure Infinispan for a JPA application or Configure Infinispan for a native Hibernate application ? Is both kind of configuration true?
  • What is the right way to query the 2nd level chache about read and hit entities?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.3.2

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