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.

Continue reading “The best way to handle the LazyInitializationException”

Advertisements

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.

Continue reading “The hibernate.enable_lazy_load_no_trans Anti-Pattern”