The LazyInitializationException is thrown when trying to access a relationship with another entity which is not initialized and without an active session. The below simple code snippet explains this reason.  Example.java  EntityManagerem = emf.createEntityManager();
em.getTransaction().begin();
Author a = em.find(Author.class, 1L);
em.getTransaction().commit();
em.close();
logger.info(a.getFirstName() + " "+ a.getLastName() + " wrote "+a.getBooks().size() + " books."); The best way to fix a LazyInitializationException is to initialize the required relationship in the business tier. It is also not advisable to initialize all relationships just because there might be one client out there who needs one of them. For performance reasons, you should only initialize the relationships you need.