I have a spring boot application and need to setup Redis as l2 cache on hibernate. My prop file looks like: I created a custom region factory because I don’t want to use json or yaml files. (right now, the parameters are hardcoded). CustomRegionFactory class looks like: Using redis-cli I found out that all my entities annotated with @Cacheable are
Tag: caching
Infinispan : locking in remote transactional cache
We try to use infinispan as a remote cache with a read lock. The clients are making a read with a “put” in order to acquire a lock on the key, like described infinispan documentation in the section pessimistic transactional cache “When cache.put(k1,v1) returns, k1 is locked and no other transaction running anywhere in the cluster can write to it.
Understanding Dao-pattern, can it be used for retrieving data from cache?
I read about DAO-pattern in the official documentation and it’s not quite clear if it can be used for retrieving data from cache? Formally speaking, DAO is an additional abstraction layer between clients and mechanism the data is being retrieved from somewhere. So, if data resides in cache, I suppose we might as well call the DAO something like But
First level cache not working with JPA and Hibernate
I an new to use hibernate caching (first level, 2nd level and query cache). My project is configured using Spring MVC and JPA. I am testing first level cache using JUnit test case below. And my entity class is defined as : This should execute native query once in case first level cache is by default enabled. But I am
Guava cache and preserving checked exceptions
I’m refactoring some code to use guava Cache. Initial code: In order not to break something I need to preserve any thrown exception as is, without wrapping it. Current solution appears somewhat ugly: Is there any possible way to make it nicer? Answer Just after writing the question started thinking about utility method powered with generics. Then remembered something about
When and how to use hibernate second level cache?
I have trouble understanding when hibernate hits the second level cache and when does it invalidate the cache. This is what I currently understand: Second level cache stores entities between …