Hello,
I get org.hibernate.LazyInitializationException when i try to use saveOrUpdateCopy method using Hibernate3. But surprisingly i do not see this error when i use saveOrUpdate method.
Here is the exception trace:
ERROR org.hibernate.LazyInitializationException - illegal access to loading collection
org.hibernate.LazyInitializationException: illegal access to loading collection
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentList.iterator(PersistentList.java:115)
at com.iciciprudential.blaze.model.UnderWritingApp.setContracts(UnderWritingApp.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
Looks like its throwing in the place where i am trying to fetch a collection.
Here is the extract from .hbm.xml file:
<list name="contracts" cascade="all" inverse="false" lazy="false">
<key>
<column name="APP_ID" />
</key>
<index column="IDX" />
<one-to-many class="Contract" />
</list>
I have tried with lazy="false", but looks like no luck. any thoughts ?
|