|

Hibernate LazyInitialization Exception

Would you agree that loading only as little data as needed, a.k.a lazy loading, is a good practice? You probably  would. To prevent lengthy object graphs be loaded into memory Hibernate uses lazy loading by default. The downside is that sooner or later you are destined to see something like this:   org.hibernate.LazyInitializationException: could not…