• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

error: no session or session was closed

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<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>

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Everybody's invited. Even this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic