You have the option to tell Hibernate which caching implementation to use by specifying the name of a class that implements org.hibernate.cache.CacheProvider using the property hibernate.cache.provider_class.
我整理了下,具体看下面的表格
Cache | Provider class | Type | Cluster Safe | Query Cache Supported |
---|---|---|---|---|
Hashtable (not intended for production use) |
org.hibernate. cache.HashtableCacheProvider |
memory | yes | |
EHCache | org.hibernate. cache.EhCacheProvider |
memory, disk | yes | |
OSCache | org.hibernate. cache.OSCacheProvider |
memory, disk | yes | |
SwarmCache | org.hibernate. cache.SwarmCacheProvider |
clustered (ip multicast) | yes (clustered invalidation) | |
JBoss TreeCache | org.hibernate. cache.TreeCacheProvider |
clustered (ip multicast), transactional | yes (replication) | yes (clock sync req.) |