Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

failed to lazily initialize a collection of role hibernate3

 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I have one to one mapping between three objects.
Job --> salesRole --> positionTemplate.

I am getting this "failed to lazily initialize a collection of role" error with hibernate 3. i tried to use lazy="false" to force hibernate to load eagerly.
still i get the same error when i try to access position template fields. Here are my hibernate mapping files.
job.hbm.xml


SalesRole.hbm.xml

position template.hbm.xml


Can some one please point out the problem. here is how i am loading Job object.



i tried to use http://today.java.net/pub/a/today/2005/10/11/testing-hibernate-mapping.html?page=last not to load beans lazily. the commented code in above method shows that. that gives the same problem. I have been trying to figure it out for the past two days. appreciate any kind of help regarding this.
thanks
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am retrieving all this information in a DTO, and then comitting the transaction. can some one point out what else is wrong here?
thanks
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!