org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: entity.Order.orderLine, could not initialize proxy - no Session

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

,
via Stack Overflow by JamesENL

Use the proper ORM annotations (@ManyToOne and @OneToMany).

,
via Stack Overflow by Kleber Mota

Use eager fetch (fetch = FetchType.EAGER) annotation.

Solutions on the web

via co.jp by Unknown author, 1 year ago
failed to lazily initialize a collection of role: entity.Order.orderLine, could not initialize proxy - no Session
via co.jp by Unknown author, 1 year ago
failed to lazily initialize a collection of role: entity.Order.orderLine, could not initialize proxy - no Session
via Stack Overflow by ProSyth
, 2 years ago
failed to lazily initialize a collection of role: com.atorresbr.springapp.model.Empresa.ldiarios, could not initialize proxy - no Session
via Stack Overflow by alexander
, 8 months ago
failed to lazily initialize a collection of role: de.financeme.model.MonthOverview.records, could not initialize proxy - no Session
via Stack Overflow by Vercryger
, 2 years ago
failed to lazily initialize a collection of role: org.myorg.testing.domains.Person.tasks, could not initialize proxy - no Session
via jhuep.com by Unknown author, 1 year ago
failed to lazily initialize a collection of role: org.myorg.jpatickets.bo.Event.tickets, could not initialize proxy - no Session
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: entity.Order.orderLine, could not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:575)
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:214)
at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:155)
at javax.faces.model.ListDataModel.isRowAvailable(ListDataModel.java:109)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
5 times, 1 year ago
Once, 4 months ago
132 times, 6 months ago

Write tip

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