org.hibernate.LazyInitializationException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

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

tip

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

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • 質問の編集履歴 - QA@IT
    via by Unknown author,
  • Strange lazy loading exception
    via Stack Overflow by Mariusz Grodek
    ,
    • 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 org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:278) at javax.faces.model.ListDataModel.isRowAvailable(ListDataModel.java:109) at javax.faces.model.ListDataModel.setRowIndex(ListDataModel.java:184)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    ivanszkypeterivanszkypeter
    132 times, last one,
    linxiaolonglinxiaolong
    5 times, last one,
    PilleoPilleo
    1 times, last one,
    tvrmsmithtvrmsmith
    1 times, last one,
    38 more bugmates