Common Hibernate Exceptions Every Developer Must Know
|

Common Hibernate Exceptions Every Developer Must Know

Every framework has a set of exceptions that indicate common error scenarios. Understanding them will help you turn a task that could drag along for days into a quickly-implemented feature. When working with Hibernate, they tell you about issues with your database queries, mapping mistakes, and problems during write operations. In this article, I want…

Your 2 best options to fix Hibernate’s MultipleBagFetchException

Your 2 best options to fix Hibernate’s MultipleBagFetchException

You probably learned that you should use FetchType.LAZY for all of your associations. It ensures that Hibernate initializes an association when you use it and doesn’t spend any time getting data you don’t need. Unfortunately, this introduces a new issue. You now need to use a JOIN FETCH clause or an EntityGraph to fetch the…