Questions tagged [hibernate-cache]

73 questions
0
votes
0 answers

Ehcache 3.10.8 version class for hibernate.cache.provider_class property

We are upgrading the Ehcache version from 2.10.9.2 to ehcache 3.10.8 but we are using hybernate 3.2.3 version. Currently we are using below provider class from ehcache 2.10.9.2. I did not find the relevant provider classin 3.10.8.
0
votes
0 answers

enable cache for all criteria queries in throughout the project

I enabled second level cache in hibernate. true true
or123456
  • 2,091
  • 8
  • 28
  • 50
0
votes
0 answers

Can JPA Criteria query results be cached?

This post explains how to cache query results. But I am more interested in caching the results of jpa criteria query. My criteria query is roughly as below - CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery query =…
samshers
  • 1
  • 6
  • 37
  • 84
0
votes
1 answer

Does EntityManager.getReference() matter if the entity is @Cached/@Cacheable?

Say I want to update entity A which references B but B is a big entity. If B is not a cached entity (2nd-level), I normally do a getReference() if I have access to B's PK to avoid the extra SELECT query. Now if B is cached (2nd-level), will…
Rey Libutan
  • 5,226
  • 9
  • 42
  • 73
0
votes
1 answer

Is putting @Cacheable or @Cache above the Entity enough for Hibernate to start caching?

Is it enough and Hibernate checks methods automatically that are doing stuff with that entity and updates the cache? Or @Cacheable, @CachePut, @CacheEvict annotations above methods are mandatory for a working cache.
user16613329
0
votes
1 answer

Hibernate L2 cache issues with EntityGraph and LEFT JOIN FETCH queries

I'm using hibernate 5.3.14 with hazelcast 3.11.5 as L2 cache provider and spring boot 2.1.11. I have 3 entities defined with relations: one order has many order items one order has many custom fields L2 cache is enabled for entities, associations…
Ionut B
  • 3
  • 2
0
votes
0 answers

caching relations mapped by other entity

I'm trying to cache some of my entities that only get changed when the server is down. Here is an example: @Entity @Cache(usage=CacheConcurrencyStrategy.READ_ONLY) public class Season { @Cache(usage=CacheConcurrencyStrategy.READ_ONLY) …
EasterBunnyBugSmasher
  • 1,507
  • 2
  • 15
  • 34
0
votes
1 answer

Where does external caches like ehcache / redis fit w.r.t hibernate level 1 / level 2 caches?

Hibernate (and so JPA which is wrapper on hibernate) provides two levels of caching mechanisms. a) level 1 cache which is at session object layer/level b) level 2 cache which is at session factory layer/level If I am using external caches like redis…
user14305942
0
votes
1 answer

Spring Boot Application and Hazelcast NearCache

I am trying to use Hazelcast caching with Spring Boot, having read some documentation I decided to settle for Near Cache configurations, I would like to cache some method calls and use it for Hibernate L2 caching.. the trouble is I haven't exactly…
0
votes
0 answers

Natural ID with Hibernate Second Level Cache

I am working on a Spring boot project where i am using Hibernate as ORM. I have enabled Hibernate Second Level Caching. I have an entity called Country. In country i have a natural Id and i have enabled cache based on Natural…
0
votes
0 answers

Infinispan - Hibernate 2nd Level Cache Cluster Marshaling issue

We are trying to configure infinispan as the 2nd level cache for Hibernate in Jboss EAP 7.1 and run the jboss in clustered two node setup. Lookup for cache elements works, but if we update hibernate entities, then update cache step triggered by…
0
votes
2 answers

Circuit-break L2 cache in Hibernate in case of redis connection issues

I am using redisson-hibernate as Hibernate 2nd level Cache provider. If redis server becomes unavailable, while the application is running, the whole application goes down. I am trying to find a way to circuit-break the L2 cache in such a…
Aayush
  • 83
  • 1
  • 5
0
votes
1 answer

Grails return just id of entity

I have an entity Product and inside of entity, i have Contry entity. When i execute Product.find or Product.get and get country value, my country values has just id value, but in country entity i have id, name and code [id: 1, code:null, name:null],…
Mister B
  • 123
  • 2
  • 15
0
votes
1 answer

shared infinispan 2LC cache

I have two applications using same database entities. Both applications are deployed on jboss eap 6.2 separate clusters. DB tables are updated only from one application but are read from both applications. Both applications are using native…
0
votes
0 answers

Hibernate return last fetch and modified object instead fetch new one

my problem is this. ill try to make it simple. I am using spring data jpa +spring boot (hibernate config) with mysql. I have a class (entity) like this. public class A { @EmbeddedId Aid id; @OneToMany(fetch = FetchType.EAGER, mappedBy = "a") …