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.

  • org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: br.gov.jfrj.siga.sr.model.SrItemConfiguracao.meuItemHistoricoSet, could not initialize proxy - no Session at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:566) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:186) at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545) at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:124) at org.hibernate.collection.internal.PersistentBag.get(PersistentBag.java:439) at br.gov.jfrj.siga.sr.model.SrItemConfiguracao.getAtual(SrItemConfiguracao.java:198) at br.gov.jfrj.siga.sr.model.SrConfiguracaoBL.deduzFiltro(SrConfiguracaoBL.java:43) at br.gov.jfrj.siga.cp.bl.CpConfiguracaoBL.buscaConfiguracao(CpConfiguracaoBL.java:308) at br.gov.jfrj.siga.sr.model.SrConfiguracao.buscar(SrConfiguracao.java:454) at br.gov.jfrj.siga.sr.model.SrConfiguracao.buscarAssociacao(SrConfiguracao.java:469) at br.gov.jfrj.siga.sr.model.SrSolicitacao.getAtributoAssociados(SrSolicitacao.java:835) at br.gov.jfrj.siga.sr.model.SrSolicitacao.getObrigatoriedadeTiposAtributoAssociados(SrSolicitacao.java:813) at br.gov.jfrj.siga.sr.vraptor.SolicitacaoController.validarFormReclassificar(SolicitacaoController.java:348) at br.gov.jfrj.siga.sr.vraptor.SolicitacaoController.escalonarGravar(SolicitacaoController.java:736)

Users with the same issue

PilleoPilleo
1 times, last one,
slashslash
1 times, last one,
ivanszkypeterivanszkypeter
132 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
linxiaolonglinxiaolong
2 times, last one,
38 more bugmates