Thoughts-on-Java.org is now Thorben-Janssen-com

As you might have recognized, thoughts-on-java.org is now thorben-janssen.com. But don’t worry, it’s only a different domain name and nothing really changed. Thoughts-on-java.org gets redirected to thorben-janssen.com, all articles and courses are still there and you can keep all of your bookmarks. I also implemented a small redesign. Well, internally and especially technically, it was a…

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…