org.hibernate.LazyInitializationException

failed to lazily initialize a collection of role: de.rapidanalytics.entity.PropertiesMap.properties, could not initialize proxy - no Session

Samebug tips2

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

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

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web143

  • via Unknown by Unknown author,
  • via Stack Overflow by Jannis Alexakis
    ,
  • via GitHub by xiegengcai
    ,
  • Stack trace

    • org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: de.rapidanalytics.entity.PropertiesMap.properties, could not initialize proxy - no Session at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:566)[hibernate-core-4.2.0.Final.jar:4.2.0.Final] at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:186)[hibernate-core-4.2.0.Final.jar:4.2.0.Final] at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)[hibernate-core-4.2.0.Final.jar:4.2.0.Final] at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124)

    Write tip

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

    Users with the same issue

    mauritiusmauritius
    5 times, last one
    aidoanaidoan
    3 times, last one
    PilleoPilleo
    Once,
    slashslash
    Once,
    ivanszkypeterivanszkypeter
    132 times, last one
    40 more bugmates