Infinispan as Second Level JPA Cache

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

EAP deployments expose a pre-configured cache container named "hibernate", that is offered as second-level JPA cache for use by applications. The "hibernate" cache-container is a part of the entire EAP clustering stack, All servers in the cluster are expected to be identical from the point of view of applications deployed, the application types are expected to be available on all cluster nodes.

Example

<subsystem xmlns="urn:jboss:domain:infinispan:1.5">
    <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">
        <transport lock-timeout="60000"/>
        <local-cache name="local-query">
            <transaction mode="NONE"/>
            <eviction strategy="LRU" max-entries="10000"/>
            <expiration max-idle="100000"/>
        </local-cache>
        <invalidation-cache name="entity" mode="SYNC">
            <transaction mode="NON_XA"/>
            <eviction strategy="LRU" max-entries="10000"/>
            <expiration max-idle="100000"/>
        </invalidation-cache>
        <replicated-cache name="timestamps" mode="ASYNC">
            <transaction mode="NONE"/>
            <eviction strategy="NONE"/>
        </replicated-cache>
    </cache-container>
</subsystem>