Question

I am working on a replication system development using Hibernate. I am trying to use hibernate caches to avoid multiple hit on db for the same data. Is there anyway we can configure hibernate named queries to look for partial data entries in cache before hitting the db.

For example:

One query requests 10 rows from the table. It is cached (as query cache). Afterwards another query requests 11 rows including the earlier 10 rows.

How can we use hibernate caches to optimize this scenario?

Was it helpful?

Solution

You need to enable entity caching in the second level cache.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top