为什么我在映射文件上设置lazy = true 时会出现此错误,但是当我将其设置为false 时它可以正常工作...
>>org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.citi.tablero.contraloria.planes.model.db.hibernate.dto.SigTcContraloriaObjetivos.children, no session or session was closed
>> at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
>> at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
>> at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
>> at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
>> at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:186)
>> at org.citi.tablero.contraloria.planes.model.db.hibernate.dao.TableroContraloriaPlanesOperativosDAO.getIndicadores(TableroContraloriaPlanesOperativosDAO.java:47)
>> at org.citi.tablero.contraloria.planes.ctrl.IndexCtrl.onCreateTree(IndexCtrl.java:59)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at org.zkoss.zk.ui.select.Selectors$ComposerEventListener.onEvent(Selectors.java:681)
>> at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2742)
>> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2713)
>> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2654)
>> at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534)
>> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:461)