org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: test.lazysetinit.Record.titles, 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

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

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 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 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 Stack Overflow by Reddy
, 2 years ago
failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsWcru.trains, no session or session was closed
via Stack Overflow by prabha
, 2 years ago
failed to lazily initialize a collection of role: ValueObjects.User.blogs, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: test.lazysetinit.Record.titles, 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, 1 year ago
Once, 1 year ago

Write tip

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