File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

failed to lazily initialize a collection of role hibernate3

 
vani venkat
Ranch Hand
Posts: 142
  • 0
  • 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
  • 0
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic