Joined: Wed Oct 05, 2005 4:51 am Posts: 3 Location: Cardiff
|
Hi,
I am getting the following exception when trying to access a lazy set in my code
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.foo.model.Bar.barSets - no session or session was closed
My Bar.hmb.xml file contains the following
<!-- bi-directional one-to-many association to BarSets -->
<set
name="barSets"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="BAR_ID" />
</key>
<one-to-many
class="com.epitiro.dao.model.BarSet"
/>
</set>
When I set lazy to false this works fine. Is there something else I need to configure to make the lazy work?
Thanks,
Simon
|
|