# Cache performance degradation after migration from Hibernate 5.6 \> 6.6

**URL:** <https://discourse.hibernate.org/t/cache-performance-degradation-after-migration-from-hibernate-5-6-6-6/11690>\
**Category:** Hibernate ORM\
**Created:** [July 30, 2025, 3:46pm UTC](https://discourse.hibernate.org/t/cache-performance-degradation-after-migration-from-hibernate-5-6-6-6/11690 "2025-07-30T15:46:20Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 16, 2026, 3:53pm UTC](https://discourse.hibernate.org/t/cache-performance-degradation-after-migration-from-hibernate-5-6-6-6/11690/8 "2026-03-16T15:53:17Z")

</div>

Well, Hibernate ORM 5 and before by default behaved as if you configure `hibernate.cache.query_cache_layout=shallow`: [Hibernate ORM User Guide](https://docs.hibernate.org/orm/7.2/userguide/html_single/#caching-query-cache-layout)

But then Hibernate ORM 6+ will also fetch data according to the configured laziness of the entity class, even if data is not in the cache. I believe ORM 5 just took what was there and you could end up with `LazyInitializationException` later. I don’t know your exact model, but I would suggest you to print the SQL queries that are executed as well to see if more queries are being executed with Hibernate ORM 6+.

---

_[View the full topic](https://discourse.hibernate.org/t/cache-performance-degradation-after-migration-from-hibernate-5-6-6-6/11690)._
