A Hibernate Session is a transaction-level cache of persistent data. It is possible to configure a cluster or JVM-level SessionFactory -level cache on a class-by-class and collection-by-collection basis. You may even plug in a clustered cache. Be careful.
Using Hibernate and BigMemory Go
java - How to enable second level cache in Hibernate - Stack Overflow
This ensures BigMemory Go will remain a first class data store for Hibernate. Configuring BigMemory Go for Hibernate is simple. The basic steps are:. For more information regarding cache configuration in Hibernate see the Hibernate documentation. The Hibernate provider is in the ehcache-core module. Download the latest version of the Ehcache core module.
Hibernate Second Level Cache
However before we move to our project, we should know different strategies for caching an object. I would not go into much detail about EHCache, my main focus will be to get it working for hibernate application. Create a maven project in the Eclipse or your favorite IDE, final implementation will look like below image. For hibernate second level cache, we would need to add ehcache-core and hibernate-ehcache dependencies in our application. EHCache uses slf4j for logging, so I have also added slf4j-simple for logging purposes.