LazyInitializationException: could not initialize proxy-the owning Session was closed

Solution 1

You have a classic case of LIE – Lazy Initialization error. This topic has been discussed so many times that I suggest to do a search on the forum and point to the hibernate documentation. Basically, you are using lazy relationships that require an open session (so the lazy loading can happen). Inside Spring you can use OpenSessionInViewFilter/Interceptor or the HibernateInterceptor to keep a Hibernate session open during a request or method calls.

Solution 2




Entity {