Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
670 views

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 ...
user avatar
0 votes
1 answer
477 views

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 ...
user avatar
0 votes
1 answer
575 views

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 ...
tinashe.chipomho's user avatar
5 votes
0 answers
463 views

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) ...
Heits's user avatar
  • 747
1 vote
1 answer
394 views

Hibernate 2nd level cache not working with GORM 6.1.11

Issue: I have a criteria query where Hibernate's 2nd level cache is used in using cache(true): User user = User.createCriteria().get { eq("id", 1l) cache(true) } When this code is hit two ...
Shashank Agrawal's user avatar
1 vote
1 answer
702 views

is it necessary for query caching region to be same as entity caching region

in my project i have enabled hibernate query caching (using ehcache) and 2nd level entity caching for some of the entities . also in the documentation it is mentioned that query caching does not store ...
Mayur's user avatar
  • 313
1 vote
1 answer
535 views

Access database by hibernate from multiple JVM instances

My application is running in multiple JVM instances (in separate docker containers). The application uses hibernate (and spring-data-jpa) to access the single database (MySQL) instance. Do I need to ...
t777's user avatar
  • 3,299
0 votes
1 answer
335 views

How to handle Hibernate cache when I have 2 applications with different DAO implementations

I have two web applications uses the same database Management web app which responsible to modify the system configurations on the database. Business web app which responsible to serve the users ...
Osama Abu Qauod's user avatar
7 votes
1 answer
12k views

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 ...
Cork Kochi's user avatar
  • 1,871
0 votes
1 answer
1k views

Integrate Ehcache with Spring MVC and Hibernate Application

I'm working on a java application which is being developed using Java (JDK 1.8), Spring MVC(Restful Web service Layer) 4.x, Hibernate 5.x, MYSQL Db and Tomcat Server 8. Everything is configured ...
Safdar Akrami's user avatar
0 votes
1 answer
467 views

hibernate query by example caching

I have the following Mapped entity: @Table(uniqueConstraints = @UniqueConstraint(columnNames = { "eKey-field-1", "eKey-field-2", "eKey-field-3" })) class EntityMapped { @Id @GeneratedValue... ...
Bogdan's user avatar
  • 712
0 votes
1 answer
312 views

How to view map content stored in HazelcastLocalCacheRegionFactory

Is it possible to view content stored in HazelcastLocalCacheRegionFactory? For non-local cache regions are stored as distributed maps so it is possible to view their content like this (or via JMX): ...
Vladimir's user avatar
1 vote
2 answers
2k views

Hibernate caches the query while data is being changed

I'm developing an application which connects to an outside service to fetch new SMS. Theses messages are stored in a local database by Hibernate. My client can search these messages based on numerous ...
mdoust's user avatar
  • 419