Questions tagged [hibernate-cache]

73 questions
12
votes
2 answers

Apache Ignite hangs on startup

We use apache ignite v2.2 as hibernate 2nd level cache in grails application. We have 4 nodes cluster with 10G RAM each. The first node starts ok. But subsequent hangs. Sometimes 2nd sometimes 3rd or 4th. Also successful startups happen but very…
Dmitry S
  • 121
  • 3
7
votes
1 answer

Ehcache migration from 2.6 to 3.00

I am trying to upgrade Ehcache for my Project from 2.6 to 3.0 version. Any replacement for net.sf.ehcache.Element and CacheExceptionHandler. Less documentation on Ehcache 3, Can anyone give some tips for upgrading Ehacahe to version 3.
Cork Kochi
  • 1,783
  • 6
  • 29
  • 45
7
votes
1 answer

'read-only cache configured for mutable entity' warn displays when application start up

I'm using Spring3.2 and JPA with Hibernate4.2.1 Final One of my entity code is like: @Entity @Table(name = "BOOLEAN_VALUES") @Cache(region = "booleanValues", usage = CacheConcurrencyStrategy.READ_ONLY) public class BooleanValue { …
Chris
  • 6,431
  • 10
  • 44
  • 59
7
votes
5 answers

Querying Hibernate cache

I have the following code: Person a = new Person(); a.setName("John"); Session session = openHibernateSession(); session.beginTransaction(); session.saveOrUpdate(a); Criteria critera =…
user1544745
  • 677
  • 2
  • 8
  • 15
5
votes
3 answers

Hibernate cache vs spring cache

Can anybody explain what is the difference between hibernate second level cache vs spring cache.? Does it make sense to use both in single application? If it is not recommend then when to use which one? Appreciated if someone give real life Scenario…
5
votes
0 answers

Hibernate Second level cache doesn't work for OneToOne associations

I am trying to enable Hibernate's 2nd level cache but cannot avoid multiple queries being issued for OneToOne relations. My models are: @Entity @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class Business { @OneToOne(mappedBy =…
Heits
  • 665
  • 5
  • 9
4
votes
4 answers

Use of Hibernate first level cache

It looks simple question .I tried a lot understand but failed. As per my knowledge Hibernate first level cache means session level cache.When we retrieve the same object more than once in same session it will retrieve from Cache. For example I have…
PSR
  • 39,804
  • 41
  • 111
  • 151
3
votes
0 answers

Hibernate query cache does not work

Here are my code : SessionFactory sf = getSession().getSessionFactory(); String query = "select r from RefEntity r where r.id in :ids"; Session s1 = sf.openSession(); s1.get(RefEntity.class, 1).getValue(); …
idmitriev
  • 4,619
  • 4
  • 28
  • 44
3
votes
1 answer

How hibernate second level cache works internally?

I have started learning about Hibernate Second level cache. I tried with the following sample code for understanding Hibernate second level cache. Session session = sessionFactory.openSession(); session.beginTransaction(); UserDetails u1 =…
Naidu
  • 95
  • 1
  • 10
2
votes
1 answer

Hibernate query cache doesn't work when criteria implies date

I have the following query: public List findArticlesById(String id) { final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); final CriteriaQuery criteriaQuery =…
2
votes
1 answer

Why we are getting exception when we enable the query-cache in hibernate.cfg.xml file by use hibernate 5.3.1.Final dependency?

I created a small second level cache program by using 'hibernate 5.3.1.final' dependency.I used below dependencies to work with Second level cache. org.hibernate hibernate-core
2
votes
0 answers

Hibernate first level cache when using projection

Hibernate uses first level cache by default and cache the queries or i say entities for a session. But what about projection. Lets say i have fired a join query from 3 table and get a small projection of it. How will first level cache be used…
Ankit Bansal
  • 2,162
  • 8
  • 42
  • 79
2
votes
1 answer

Another unnamed CacheManager already exists when using Hibernate L2 ehcache and spring boot enabledCache

I have an application that have more than 100 domain model i want to integrate ehcache and hibernate L2cache ,my application used ehcache for cache some of service s methods . my CacheConfiguration is like this package…
ali akbar azizkhani
  • 2,213
  • 5
  • 31
  • 48
2
votes
0 answers

ecache configuration in spring throws: "Named query not known Error"

Trying to run a unit test on a Dao in my Spring app I'm getting error: Named query not known. Actually I'm trying to implement cache with spring 4.2. Here is the code that is relevant to the integration: Have a look at my test cases. My test class:…
Created Bylucky
  • 255
  • 4
  • 15
2
votes
1 answer

Does Session.list() method use session cache in hibernate?

Does Hibernate cache the results get from Session.list()? What my believe is session.get() or session.load() method cache the result in the memory but session.list() doesn't as it generate lots of record that might cause memory issue but in case of…
Rohit
  • 406
  • 1
  • 5
  • 21
1
2 3 4 5