I need some pojo objects across my application so I want to know how to enable Second Level Cache. Until now by default First Level cache is enabled, I would also like to know what advantages and disadvantages of Second Level cache there are.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
This is what you need to do:
Set the following Hibernate properties:
Add an ehcache.xml file in your classpath, containing the cache configuration entries:
Define the Caching type for each entity:
JPA L2 cache is enabled, configured using the persistence property
javax.persistence.sharedCache.mode
which has values of NONE | ALL | ENABLE_SELECTIVE | DISABLE_SELECTIVE | UNSPECIFIED. Using this property is common across ALL valid JPA implementations.