Forums Register Login

error: no session or session was closed

+Pie Number of slices to send: Send
<logic:iterate name="personList" id="person">

<logic:iterate name="person" property="events" id="ev">
name = <bean:write name="person" property="firstname"/>
<bean:write name="ev" property="title" />
</logic:iterate>

</logic:iterate>
<logic:iterate name="personList" id="person">

<logic:iterate name="person" property="events" id="ev">
name = <bean:write name="person" property="firstname"/>
<bean:write name="ev" property="title" />
</logic:iterate>

</logic:iterate>



This is what I am getting when I run my jsp with above code.

failed to lazily initialize a collection of role: com.hibernate.Personpersistence.Person.events, no session or session was closed
[1/7/09 8:46:27:859 EST] 00000039 LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.

I have lazy="false" in my hibernate mapping and I still get the above error

here is my mapping file

<hibernate-mapping>
<class name="com.hibernate.Personpersistence.Person" table="Person">
<id name="person_id" column="person_id">
<generator class="increment"/>
</id>

<property name="age"/>
<property name="lastname"/>
<property name="firstname"/>

<set name="events" table="PERSON_EVENTs" lazy="false">
<key column="PERSON_ID"/>
<many-to-many column="EVENT_ID" class="com.hibernate.eventpersistence.Event"/>
</set>


</class>
</hibernate-mapping>

+Pie Number of slices to send: Send
could you please post the code you use to obtain the Persion bean ?

a possible cause would be that you are using session.load() this will cause to load the proxy try using session.get()

let me know if it works

(peace)
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 796 times.
Similar Threads
inverse=true in many-to-many doubt
Collection of values question
Need help in using tags for below code
Mapping Exception
Repeated updates on EVENT table, in Hibernate one to many mapping
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:00:37.