org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.MainData.association, no session or session was closed

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Aksanth
, 1 year ago
failed to lazily initialize a collection of role: com.MainData.association, no session or session was closed
via Google Groups by bobfromdy, 5 months ago
failed to lazily initialize a collection of role: com.bluehorse.persistence.Event.eventLinks, no session or session was closed
via Stack Overflow by varsha
, 2 years ago
failed to lazily initialize a collection of role: com.ecomm.ultimatesms.messaging.persistence.pojos.Mno.startnumbers, no session or session was closed
via Hibernate JIRA by Artur Jonak, 1 year ago
failed to lazily initialize a collection of role: test.lazysetinit.Record.titles, no session or session was closed
via Hibernate JIRA by Artur Jonak, 1 year ago
failed to lazily initialize a collection of role: test.lazysetinit.Record.titles, no session or session was closed
via Stack Overflow by Zeemee
, 2 years ago
failed to lazily initialize a collection of role: edeka.sw.phb.model.Chapter.subChapters, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.MainData.association, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 3 months ago
Samebug visitor profile picture
Unknown user
Once, 8 months ago
2 times, 8 months ago
2 times, 11 months ago
Once, 1 year ago
10 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.