Category: Uncategorized

  • Hibernate – Associations are not loaded

    If you have simple associations like this: But when you load a class entity and the students is an empty set and you are sure there are records in the students table with correct class_id, then the problem could be with one of the other associations in StudentEntity class. Eg. course is set to optional…

  • Working with Hibernate in a multi-threaded application

    Some of my learnings while working with Hibernate in a multi-threaded Spring Boot application. Multiple sessions When you start an @Async method, it runs in its own thread managed by Spring. This means that the session created by the calling method may not be shared with the async method. The async method might create its…