[jboss-cvs] JBossAS SVN: r76005 - trunk/cluster/src/resources/jboss-cache-manager.sar/META-INF.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 18 17:11:21 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-07-18 17:11:21 -0400 (Fri, 18 Jul 2008)
New Revision: 76005
Modified:
trunk/cluster/src/resources/jboss-cache-manager.sar/META-INF/jboss-cache-configs.xml
Log:
[JBAS-5781] Use READ_COMMITTED for clustered entity cache
Modified: trunk/cluster/src/resources/jboss-cache-manager.sar/META-INF/jboss-cache-configs.xml
===================================================================
--- trunk/cluster/src/resources/jboss-cache-manager.sar/META-INF/jboss-cache-configs.xml 2008-07-18 19:42:55 UTC (rev 76004)
+++ trunk/cluster/src/resources/jboss-cache-manager.sar/META-INF/jboss-cache-configs.xml 2008-07-18 21:11:21 UTC (rev 76005)
@@ -408,12 +408,8 @@
<!-- Node locking scheme -->
<attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
- <!-- Valid modes are LOCAL
- REPL_ASYNC
- REPL_SYNC
- INVALIDATION_ASYNC
- INVALIDATION_SYNC
-
+ <!-- Mode of communication with peer caches.
+
INVALIDATION_SYNC is highly recommended as the mode for use
with entity and collection caches.
-->
@@ -449,15 +445,16 @@
<attribute name="LockAcquisitionTimeout">15000</attribute>
<!--
- Indicate whether to use marshalling or not. Set this to true if you are running under a scoped
- class loader, e.g., inside an application server. Default is "false".
+ Indicate whether to use marshalling or not. Set this to true if you
+ are running under a scoped class loader, e.g., inside an application
+ server.
-->
<attribute name="UseRegionBasedMarshalling">true</attribute>
<!-- Must match the value of "useRegionBasedMarshalling" -->
<attribute name="InactiveOnStartup">true</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
<!-- Name of the DEFAULT eviction policy class. -->
@@ -487,20 +484,13 @@
<attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
<!--
- Isolation level : SERIALIZABLE
- REPEATABLE_READ (default)
- READ_COMMITTED
- READ_UNCOMMITTED
- NONE
+ READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases.
-->
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+ <attribute name="IsolationLevel">READ_COMMITTED</attribute>
- <!-- Valid modes are LOCAL
- REPL_ASYNC
- REPL_SYNC
- INVALIDATION_ASYNC
- INVALIDATION_SYNC
-
+ <!-- Mode of communication with peer caches.
+
INVALIDATION_SYNC is highly recommended as the mode for use
with entity and collection caches.
-->
@@ -538,13 +528,13 @@
<!--
Indicate whether to use marshalling or not. Set this to true if you
are running under a scoped class loader, e.g., inside an application
- server. Default is "false".
+ server.
-->
<attribute name="UseRegionBasedMarshalling">true</attribute>
<!-- Must match the value of "useRegionBasedMarshalling" -->
<attribute name="InactiveOnStartup">true</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
+ <!-- Eviction policy configurations. -->
<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
@@ -565,10 +555,96 @@
</config>
</attribute>
- </cache-config>
+ </cache-config>
+
+
+ <!-- Same as "pessimistic-entity" but here we use REPEATABLE_READ
+ instead of READ_COMMITTED. 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.
+ -->
+ <cache-config name="pessimistic-entity-repeatable">
+ <!-- Node locking scheme -->
+ <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
+ <!-- Here we use REPEATABLE_READ. -->
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+ <!-- Mode of communication with peer caches.
+
+ INVALIDATION_SYNC is highly recommended as the mode for use
+ with entity and collection caches.
+ -->
+ <attribute name="CacheMode">INVALIDATION_SYNC</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all members, in order
+ to find each other -->
+ <attribute name="ClusterName">${jboss.partition.name:DefaultPartition}-pessimistic-entity-rr</attribute>
+
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <attribute name="MultiplexerStack">${jboss.default.jgroups.stack:udp}</attribute>
+
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <attribute name="FetchInMemoryState">false</attribute>
+
+ <!--
+ The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false.
+ -->
+ <attribute name="StateRetrievalTimeout">20000</attribute>
+
+ <!--
+ Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">20000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+ <!--
+ Indicate whether to use marshalling or not. Set this to true if you
+ are running under a scoped class loader, e.g., inside an application
+ server.
+ -->
+ <attribute name="UseRegionBasedMarshalling">true</attribute>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <attribute name="InactiveOnStartup">true</attribute>
+
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- Name of the DEFAULT eviction policy class. -->
+ <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <!-- Evict LRU node once we have more than this number of nodes -->
+ <attribute name="maxNodes">10000</attribute>
+ <!-- And, evict any node that hasn't been accessed in this many seconds -->
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ <!-- Don't evict a node that's been accessed within this many seconds.
+ Set this to a value greater than your max expected transaction length. -->
+ <attribute name="minTimeToLiveSeconds">120</attribute>
+ </region>
+ <!-- Don't ever evict modification timestamps -->
+ <region name="/TS" policyClass="org.jboss.cache.eviction.NullEvictionPolicy"/>
+ </config>
+ </attribute>
+
+ </cache-config>
+
+
+
<!-- A config appropriate for query caching. Does not replicate
queries. DO NOT STORE TIMESTAMPS IN THIS CACHE.
-->
@@ -582,7 +658,7 @@
<!-- Max number of milliseconds to wait for a lock acquisition -->
<attribute name="LockAcquisitionTimeout">15000</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
+ <!-- Eviction policy configurations. -->
<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
@@ -607,31 +683,21 @@
<!-- A query cache that replicates queries. Replication is asynchronous.
- DO NOT STORE TIMESTAMPS IN THIS CACHE.
+ DO NOT STORE TIMESTAMPS IN THIS CACHE as no initial state transfer
+ is performed.
-->
<cache-config name="replicated-query">
<!-- Node locking scheme -->
<attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
- <!--
- Isolation level : SERIALIZABLE
- REPEATABLE_READ (default)
- READ_COMMITTED
- READ_UNCOMMITTED
- NONE
+ <!-- Mode of communication with peer caches.
+
+ REPL_ASYNC means replicate but sender does not block waiting for
+ peers to acknowledge applying the change. Valid for queries as
+ the timestamp cache mechanism will allow Hibernate to discard
+ out-of-date queries.
-->
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
-
- <!-- Valid modes are LOCAL
- REPL_ASYNC
- REPL_SYNC
- INVALIDATION_ASYNC
- INVALIDATION_SYNC
-
- INVALIDATION_SYNC is highly recommended as the mode for use
- with entity and collection caches.
- -->
<attribute name="CacheMode">REPL_ASYNC</attribute>
<!-- Name of cluster. Needs to be the same for all members, in order
@@ -663,14 +729,14 @@
<!--
Indicate whether to use marshalling or not. Set this to true if you
are running under a scoped class loader, e.g., inside an application
- server. Default is "false".
+ server.
-->
<attribute name="UseRegionBasedMarshalling">true</attribute>
<!-- Must match the value of "useRegionBasedMarshalling" -->
<attribute name="InactiveOnStartup">true</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
<!-- Name of the DEFAULT eviction policy class. -->
@@ -704,11 +770,7 @@
<attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
<!--
- Isolation level : SERIALIZABLE
- REPEATABLE_READ (default)
- READ_COMMITTED
- READ_UNCOMMITTED
- NONE
+ READ_COMMITTED is as strong as necessary.
-->
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
@@ -744,13 +806,13 @@
<!--
Indicate whether to use marshalling or not. Set this to true if you
are running under a scoped class loader, e.g., inside an application
- server. Default is "false".
+ server.
-->
<attribute name="UseRegionBasedMarshalling">true</attribute>
<!-- Must match the value of "useRegionBasedMarshalling" -->
<attribute name="InactiveOnStartup">true</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
+ <!-- Eviction policy configurations. -->
<attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
@@ -782,16 +844,15 @@
which can be expensive. Uses optimistic locking -->
<cache-config name="optimistic-shared">
- <!-- Node locking scheme:
- OPTIMISTIC
- PESSIMISTIC (default)
- -->
+ <!-- Node locking scheme -->
<attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
- <!-- Must use REPL since used for timestamp caching. -->
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache consistency for entities.
+ -->
<attribute name="CacheMode">REPL_SYNC</attribute>
- <!-- With OPTIMISTIC with replication we need to use synchronous commits. -->
+ <!-- With OPTIMISTIC with replication we need to use synchronous commits. -->
<attribute name="SyncCommitPhase">true</attribute>
<attribute name="SyncRollbackPhase">true</attribute>
@@ -824,15 +885,16 @@
<attribute name="LockAcquisitionTimeout">15000</attribute>
<!--
- Indicate whether to use marshalling or not. Set this to true if you are running under a scoped
- class loader, e.g., inside an application server. Default is "false".
+ Indicate whether to use marshalling or not. Set this to true if you
+ are running under a scoped class loader, e.g., inside an application
+ server.
-->
<attribute name="UseRegionBasedMarshalling">true</attribute>
<!-- Must match the value of "useRegionBasedMarshalling" -->
<attribute name="InactiveOnStartup">true</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
<!-- Name of the DEFAULT eviction policy class. -->
@@ -864,33 +926,17 @@
-->
<cache-config name="pessimistic-shared">
- <!-- TransactionManager configuration not required for Hibernate!
- Hibernate will plug in its own transaction manager integration.
- -->
-
- <!-- Node locking scheme:
- OPTIMISTIC
- PESSIMISTIC (default)
- -->
+ <!-- Node locking scheme -->
<attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
<!--
- Isolation level : SERIALIZABLE
- REPEATABLE_READ (default)
- READ_COMMITTED
- READ_UNCOMMITTED
- NONE
+ READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases.
-->
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
- <!-- Valid modes are LOCAL
- REPL_ASYNC
- REPL_SYNC
- INVALIDATION_ASYNC
- INVALIDATION_SYNC
-
- INVALIDATION_SYNC is highly recommended as the mode for use
- with entity and collection caches.
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache consistency for entities.
-->
<attribute name="CacheMode">REPL_SYNC</attribute>
@@ -931,8 +977,8 @@
<!-- Must match the value of "useRegionBasedMarshalling" -->
<attribute name="InactiveOnStartup">true</attribute>
- <!-- Specific eviction policy configurations. This is LRU -->
- <attribute name="EvictionPolicyConfig">
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
<config>
<attribute name="wakeUpIntervalSeconds">5</attribute>
<!-- Name of the DEFAULT eviction policy class. -->
@@ -952,6 +998,89 @@
</config>
</attribute>
+ </cache-config>
+
+
+
+ <!-- Same as "pessimistic-shared" but here we use REPEATABLE_READ
+ instead of READ_COMMITTED. 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.
+ -->
+ <cache-config name="pessimistic-shared-repeatable">
+
+ <!-- Node locking scheme -->
+ <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
+
+ <!-- Here we use REPEATABLE_READ. -->
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache coherency for entities.
+ -->
+ <attribute name="CacheMode">REPL_SYNC</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all members, in order
+ to find each other -->
+ <attribute name="ClusterName">${jboss.partition.name:DefaultPartition}-pessimistic-shared-rr</attribute>
+
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
+ -->
+ <attribute name="MultiplexerStack">${jboss.default.jgroups.stack:udp}</attribute>
+
+ <!-- Used for timestamps, so must fetch state. -->
+ <attribute name="FetchInMemoryState">true</attribute>
+
+ <!--
+ The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup.
+ -->
+ <attribute name="StateRetrievalTimeout">20000</attribute>
+
+ <!--
+ Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">20000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+ <!--
+ Indicate whether to use marshalling or not. Set this to true if you
+ are running under a scoped class loader, e.g., inside an application
+ server.
+ -->
+ <attribute name="UseRegionBasedMarshalling">true</attribute>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <attribute name="InactiveOnStartup">true</attribute>
+
+ <!-- Eviction policy configurations. -->
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">5</attribute>
+ <!-- Name of the DEFAULT eviction policy class. -->
+ <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <!-- Cache wide default -->
+ <region name="/_default_">
+ <!-- Evict LRU node once we have more than this number of nodes -->
+ <attribute name="maxNodes">10000</attribute>
+ <!-- And, evict any node that hasn't been accessed in this many seconds -->
+ <attribute name="timeToLiveSeconds">1000</attribute>
+ <!-- Don't evict a node that's been accessed within this many seconds.
+ Set this to a value greater than your max expected transaction length. -->
+ <attribute name="minTimeToLiveSeconds">120</attribute>
+ </region>
+ <!-- Don't ever evict modification timestamps -->
+ <region name="/TS" policyClass="org.jboss.cache.eviction.NullEvictionPolicy"/>
+ </config>
+ </attribute>
+
</cache-config>
</cache-configs>
More information about the jboss-cvs-commits
mailing list