Infinispan as Second Level JPA Cache: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:


* [[JBoss JPA#Subjects|JBoss JPA]]
* [[JBoss JPA#Subjects|JBoss JPA]]
=Overview=
EAP deployments expose a pre-configured cache container named "hibernate", that is offered as second-level JPA cache for use by applications:
<syntaxhighlight lang='xml'>
<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>
</syntaxhighlight>

Revision as of 20:23, 3 August 2017

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:

<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>