-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.LazyInitializationException: could not initial
PostPosted: Thu Oct 09, 2008 11:19 pm 
Newbie

Joined: Thu Oct 09, 2008 10:27 pm
Posts: 3
Dear

Could you help me to solve this problem, when I run my application, I got the exception: org.hibernate.LazyInitializationException: could not initialize proxy - no Session

public void setEnterSchoolCurrentContestant(Contestant1 enterSchoolCurrentContestant) {
this.enterSchoolCurrentContestant = enterSchoolCurrentContestant;
Hibernate.initialize(enterSchoolCurrentContestant.getCandidatetimes());
this.enterschoolCurrentCandidatetimes = enterSchoolCurrentContestant.getCandidatetimes();
Hibernate.initialize(this.enterschoolCurrentCandidatetimes.getAcademicyear());
this.enterschoolCurrentAcaYear = this.enterschoolCurrentCandidatetimes.getAcademicyear();
Hibernate.initialize(this.enterschoolCurrentCandidatetimes.getSemester());
this.enterschoolCurrentSemester = this.enterschoolCurrentCandidatetimes.getSemester();
}

Thank for your help

_________________
Pham Ngoc Bao Cuong
http://www.s3s.com.vn


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2008 5:52 am 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
Hi pnbaocuong,

to initialize the collection wrapper, you should pass the current session which is opened.


http://www.javalobby.org/java/forums/t20533.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2008 10:05 pm 
Newbie

Joined: Thu Oct 09, 2008 10:27 pm
Posts: 3
Thanks alot

_________________
Pham Ngoc Bao Cuong
http://www.s3s.com.vn


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.