Configuration defaults for JPA/Hibernate implementations
This topic has not yet been written. The content below is from the topic description.
Default Configuration Explained The aim of this section is to explain the default settings for each of the different global data type (entity, collection, query and timestamps) caches, why these were chosen and what are the available alternatives. Defaults for Entity/Collection Caching By default, for all entities and collections, whenever an new entity or collection is read from database and needs to be cached, it's only cached locally in order to reduce intra-cluster traffic. This option cannot be changed. By default, all entities and collections are configured to use a synchronous invalidation as clustering mode. This means that when an entity is updated, the updated cache will send a message to the other members of the cluster telling them that the entity has been modified. Upon receipt of this message, the other nodes will remove this data from their local cache, if it is stored there. This option can be changed to use replication by configuring entities or collections to use "replicated-entity" cache but it's not recommended. By default, all entities and collections have initial state transfer disabled since there's no need for it. It it's not recommended that this is enabled. By default, entities and collections are configured to use READ_COMMITTED as cache isolation level. It would only make sure to configure REPEATABLE_READ 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. If you really need to use REPEATABLE_READ, you can simply configure entities or collections to use "entity-repeatable" cache. By default, entities and collections are configured with eviction settings: Eviction wake up interval is 5 seconds. Max number of entries are 10.000 Max idle time before expiration is 100 seconds       You can change these settings on a per entity or collection basis or per individual entity or collection type.       More information in the "Advanced Configuration" section below. Finally, by default, both entites and collections are configured with lazy deserialization which helps deserialization when entities or collections are stored in isolated deployments. If you're sure you'll never deploy your entities or collections in classloader isolated deployment archives, you can disable this settting. Defaults for Query Caching By default, query cache is configured so that queries are only cached locally. Alternatively, you can configure query caching to use replication by selecting the "replicated-query" as query cache name. However, replication for query cache only makes sense if, and only if, all of this conditions are true: query is quite expensive query is very likely to be repeated in different cluster nodes and query is unlikely to be invalidated out of the cache (Note: Hibernate must agressively invalidate query results from the cache any time any instance of one of the entity classes involved in the query's WHERE clause changes. All such query results are invalidated, even if the change made to the entity instance would not have affected the query result) By default, query cache uses the same cache isolation levels and eviction/expiration settings as for entities/collections. By default, query cache has initial state transfer disabled. It is not recommended that this is enabled. Defaults for Timestamps Cache By default, timestamps cache is configured with asynchronous replication as clustering mode. Local or invalidated cluster modes are not allowed, since all cluster nodes must store all timestamps. As a result, no eviction/expiration is allowed for timestamp caches either. By default, timestamps is configured with a cluster cache loader (in Hibernate 3.6.0 or earlier it had state transfer enabled) so that joining nodes can get all timestamps. You shouldn't attempt disable the cluster cache loader for timestamps cache.