HHH-9632 Update to Infinispan 7.1.0.Final

This commit is contained in:
Galder Zamarreño 2015-03-02 09:49:39 +01:00
parent 9337f73185
commit 260ff03ae5
4 changed files with 81 additions and 131 deletions

View File

@ -1,134 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:6.0" xmlns="urn:infinispan:config:7.0"
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd"> xsi:schemaLocation="urn:infinispan:config:7.0 http://www.infinispan.org/schemas/infinispan-config-7.0.xsd">
<global>
<transport
transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"
clusterName="infinispan-hibernate-cluster"
distributedSyncTimeout="50000"
strictPeerToPeer="false">
<!-- Note that the JGroups transport uses sensible defaults if no configuration property is defined. -->
<properties>
<!--<property name="configurationFile" value="jgroups-tcp.xml"/>-->
<property name="configurationFile"
value="${hibernate.cache.infinispan.jgroups_cfg:jgroups-tcp.xml}"/>
</properties>
<!-- See the JGroupsTransport javadocs for more flags -->
</transport>
</global>
<default> <jgroups>
<!-- Used to register JMX statistics in any available MBean server --> <stack-file name="hibernate-jgroups" path="${hibernate.cache.infinispan.jgroups_cfg:jgroups-tcp.xml}"/>
<jmxStatistics enabled="false"/> </jgroups>
</default>
<!-- Default configuration is appropriate for entity/collection caching. --> <cache-container name="SampleCacheManager" statistics="false" default-cache="the-default-cache" shutdown-hook="DEFAULT">
<namedCache name="entity"> <transport stack="hibernate-jgroups" cluster="infinispan-hibernate-cluster"/>
<clustering mode="invalidation">
<stateTransfer fetchInMemoryState="false" timeout="20000"/>
<sync replTimeout="20000"/>
</clustering>
<locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"
lockAcquisitionTimeout="15000" useLockStriping="false"/>
<!-- Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds.
0 means the eviction thread will never run. A separate executor is used for eviction in each cache. -->
<eviction maxEntries="10000" strategy="LRU"/>
<expiration maxIdle="100000" wakeUpInterval="5000"/>
<transaction transactionMode="TRANSACTIONAL" autoCommit="false"
lockingMode="OPTIMISTIC"/>
</namedCache>
<!-- Default configuration is appropriate for entity/collection caching. --> <local-cache name="the-default-cache" statistics="false" />
<namedCache name="entity-repeatable">
<clustering mode="invalidation">
<stateTransfer fetchInMemoryState="false" timeout="20000"/>
<sync replTimeout="20000"/>
</clustering>
<!-- Note: REPEATABLE_READ is only useful if the application evicts/clears entities
from the Hibernate Session and then expects to repeatably re-read them in
the same transaction. Otherwise, the Session's internal cache provides a
repeatable-read semantic. Before choosing this config, carefully read the docs
and make sure you really need REPEATABLE_READ.
-->
<locking isolationLevel="REPEATABLE_READ" concurrencyLevel="1000"
lockAcquisitionTimeout="15000" useLockStriping="false"/>
<!-- Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds.
0 means the eviction thread will never run. A separate executor is used for eviction in each cache. -->
<eviction maxEntries="10000" strategy="LRU"/>
<expiration maxIdle="100000" wakeUpInterval="5000"/>
<transaction transactionMode="TRANSACTIONAL" autoCommit="false"
lockingMode="OPTIMISTIC"/>
</namedCache>
<!-- An alternative configuration for entity/collection caching that uses replication instead of invalidation --> <!-- Default configuration is appropriate for entity/collection caching. -->
<namedCache name="replicated-entity"> <invalidation-cache name="entity" mode="SYNC" remote-timeout="20000">
<clustering mode="replication"> <locking isolation="READ_COMMITTED" concurrency-level="1000" acquire-timeout="15000" striping="false"/>
<stateTransfer fetchInMemoryState="false" timeout="20000"/> <transaction mode="NON_XA" locking="OPTIMISTIC" auto-commit="false"/>
<sync replTimeout="20000"/> <eviction max-entries="10000" strategy="LRU"/>
</clustering> <expiration max-idle="100000" interval="5000"/>
<locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" </invalidation-cache>
lockAcquisitionTimeout="15000" useLockStriping="false"/>
<!-- Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds.
0 means the eviction thread will never run. A separate executor is used for eviction in each cache. -->
<eviction maxEntries="10000" strategy="LRU"/>
<expiration maxIdle="100000" wakeUpInterval="5000"/>
<lazyDeserialization enabled="true"/>
<transaction transactionMode="TRANSACTIONAL" autoCommit="false"
lockingMode="OPTIMISTIC"/>
</namedCache>
<!-- A config appropriate for query caching. Does not replicate queries. --> <!-- Default configuration is appropriate for entity/collection caching. -->
<namedCache name="local-query"> <invalidation-cache name="entity-repeatable" mode="SYNC" remote-timeout="20000">
<locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" <locking isolation="REPEATABLE_READ" concurrency-level="1000" acquire-timeout="15000" striping="false"/>
lockAcquisitionTimeout="15000" useLockStriping="false"/> <transaction mode="NON_XA" locking="OPTIMISTIC" auto-commit="false"/>
<!--Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds. 0 means <eviction max-entries="10000" strategy="LRU"/>
the eviction thread will never run. A separate executor is used for eviction in each cache. --> <expiration max-idle="100000" interval="5000"/>
<eviction maxEntries="10000" strategy="LRU"/> </invalidation-cache>
<expiration maxIdle="100000" wakeUpInterval="5000"/>
<transaction transactionMode="TRANSACTIONAL" autoCommit="false"
lockingMode="OPTIMISTIC"/>
</namedCache>
<!-- A query cache that replicates queries. Replication is asynchronous. --> <!-- An alternative configuration for entity/collection caching that uses replication instead of invalidation -->
<namedCache name="replicated-query"> <replicated-cache name="replicated-entity" mode="SYNC" remote-timeout="20000">
<clustering mode="replication"> <locking isolation="READ_COMMITTED" concurrency-level="1000" acquire-timeout="15000" striping="false"/>
<async/> <transaction mode="NON_XA" locking="OPTIMISTIC" auto-commit="false"/>
</clustering> <eviction max-entries="10000" strategy="LRU"/>
<locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" <expiration max-idle="100000" interval="5000"/>
lockAcquisitionTimeout="15000" useLockStriping="false"/> <state-transfer enabled="false"/>
<!--Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds. 0 means </replicated-cache>
the eviction thread will never run. A separate executor is used for eviction in each cache. -->
<eviction maxEntries="10000" strategy="LRU"/>
<expiration maxIdle="100000" wakeUpInterval="5000"/>
<transaction transactionMode="TRANSACTIONAL" autoCommit="false"
lockingMode="OPTIMISTIC"/>
<!-- State transfer forces all replication calls to be synchronous,
so for calls to remain async, use a cluster cache loader instead -->
<persistence passivation="false">
<cluster remoteCallTimeout="20000" />
</persistence>
</namedCache>
<!-- Optimized for timestamp caching. A clustered timestamp cache <!-- A config appropriate for query caching. Does not replicate queries. -->
is required if query caching is used, even if the query cache <local-cache name="local-query">
itself is configured with CacheMode=LOCAL. --> <locking isolation="READ_COMMITTED" concurrency-level="1000" acquire-timeout="15000" striping="false"/>
<namedCache name="timestamps"> <transaction mode="NON_XA" locking="OPTIMISTIC" auto-commit="false"/>
<clustering mode="replication"> <eviction max-entries="10000" strategy="LRU"/>
<async/> <expiration max-idle="100000" interval="5000"/>
</clustering> </local-cache>
<locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"
lockAcquisitionTimeout="15000" useLockStriping="false"/> <!-- A query cache that replicates queries. Replication is asynchronous. -->
<!-- Don't ever evict modification timestamps --> <replicated-cache name="replicated-query" mode="ASYNC">
<eviction strategy="NONE"/> <locking isolation="READ_COMMITTED" concurrency-level="1000" acquire-timeout="15000" striping="false"/>
<expiration wakeUpInterval="0"/> <transaction mode="NON_XA" locking="OPTIMISTIC" auto-commit="false"/>
<!-- Explicitly non transactional --> <eviction max-entries="10000" strategy="LRU"/>
<transaction transactionMode="NON_TRANSACTIONAL"/> <expiration max-idle="100000" interval="5000"/>
<!-- State transfer forces all replication calls to be synchronous, <persistence passivation="false">
so for calls to remain async, use a cluster cache loader instead --> <!-- State transfer forces all replication calls to be synchronous,
<persistence passivation="false"> so for calls to remain async, use a cluster cache loader instead -->
<cluster remoteCallTimeout="20000" /> <cluster-loader remote-timeout="20000"/>
</persistence> </persistence>
</namedCache> </replicated-cache>
<!-- Optimized for timestamp caching. A clustered timestamp cache
is required if query caching is used, even if the query cache
itself is configured with CacheMode=LOCAL. -->
<replicated-cache name="timestamps" mode="ASYNC">
<locking isolation="READ_COMMITTED" concurrency-level="1000" acquire-timeout="15000" striping="false"/>
<!-- Explicitly non transactional -->
<transaction mode="NONE"/>
<!-- Don't ever evict modification timestamps -->
<eviction strategy="NONE"/>
<expiration interval="0"/>
<persistence passivation="false">
<!-- State transfer forces all replication calls to be synchronous,
so for calls to remain async, use a cluster cache loader instead -->
<cluster-loader remote-timeout="20000"/>
</persistence>
<state-transfer enabled="false"/>
</replicated-cache>
</cache-container>
</infinispan> </infinispan>

View File

@ -110,6 +110,7 @@ public abstract class AbstractGeneralDataRegionTestCase extends AbstractRegionIm
assertNull( "remote is clean", remoteRegion.get( KEY ) ); assertNull( "remote is clean", remoteRegion.get( KEY ) );
regionPut(localRegion); regionPut(localRegion);
sleep( 250 );
assertEquals( VALUE1, localRegion.get( KEY ) ); assertEquals( VALUE1, localRegion.get( KEY ) );
// allow async propagation // allow async propagation

View File

@ -29,9 +29,11 @@ import org.infinispan.AdvancedCache;
import org.infinispan.configuration.cache.CacheMode; import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.Configuration; import org.infinispan.configuration.cache.Configuration;
import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.eviction.EvictionStrategy; import org.infinispan.eviction.EvictionStrategy;
import org.infinispan.manager.DefaultCacheManager; import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager; import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.test.TestingUtil;
import org.junit.Test; import org.junit.Test;
import org.hibernate.cache.CacheException; import org.hibernate.cache.CacheException;
@ -290,18 +292,19 @@ public class InfinispanRegionFactoryTestCase {
} }
} }
@Test @Test(expected = CacheException.class)
public void testTimestampValidation() { public void testTimestampValidation() {
Properties p = new Properties(); Properties p = new Properties();
final DefaultCacheManager manager = new DefaultCacheManager(); final DefaultCacheManager manager = new DefaultCacheManager(GlobalConfigurationBuilder.defaultClusteredBuilder().build());
InfinispanRegionFactory factory = createRegionFactory(manager, p);
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.INVALIDATION_SYNC);
manager.defineConfiguration("timestamps", builder.build());
try { try {
InfinispanRegionFactory factory = createRegionFactory(manager, p);
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.INVALIDATION_SYNC);
manager.defineConfiguration("timestamps", builder.build());
factory.start(null, p); factory.start(null, p);
fail("Should have failed saying that invalidation is not allowed for timestamp caches."); fail("Should have failed saying that invalidation is not allowed for timestamp caches.");
} catch(CacheException ce) { } finally {
TestingUtil.killCacheManagers(manager);
} }
} }

View File

@ -30,7 +30,7 @@ ext {
junitVersion = '4.11' junitVersion = '4.11'
h2Version = '1.2.145' h2Version = '1.2.145'
bytemanVersion = '2.1.2' bytemanVersion = '2.1.2'
infinispanVersion = '6.0.0.Final' infinispanVersion = '7.1.0.Final'
jnpVersion = '5.0.6.CR1' jnpVersion = '5.0.6.CR1'
libraries = [ libraries = [