The best way to handle the LazyInitializationException

Introduction The LazyInitializationException is undoubtedly one of the most common exceptions you can get when using Hibernate. This article is going to summarize the best and the worst ways of handling lazy associations.

The hibernate.enable_lazy_load_no_trans Anti-Pattern

Introduction I’ve already written about the Open Session in View Anti-Pattern, so now it’s time to add another Hibernate fetching bad practices. Although the hibernate.enable_lazy_load_no_trans configuration property is a lesser-known setting, it’s good to know why you shouldn’t employ it in your data access layer code.

Black Friday 50% off the High-Performance Java, Spring, and SQL course bundle: 24 hours of video lessons Get the Bundle

Black Friday

Seize the deal! 50% off my video courses

Java Persistence Video Course Save 50% Buy Now SQL Video Course Save 50% Buy Now Spring Persistence Video Course Save 50% Buy Now

The BLACKFRIDAY26 coupon is applied automatically at checkout.