-->
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.  [ 2 posts ] 
Author Message
 Post subject: Reattach an object + LazyInitializationException
PostPosted: Fri Sep 21, 2007 8:12 am 
Beginner
Beginner

Joined: Fri Oct 06, 2006 2:49 am
Posts: 25
Hello everybody,

I have spend some time on the forum and googling and I do not find a solution to this problem.

I am currently struggling to reattach an object to the session.

Here is basically what I do:


beginTransaction();
dao.update(myPersistentObject);
myPersistentObject.getLazyProperty();
endTransaction();


I get an LazyInitializationException when I am accessing Lazy fields of an object that I just have reattached to the session.

I am in a transaction and I must make an update (not a lock()) because my object has changed.

Does anybody have a suggestion to resolve this problem ?

I do not understand why this is happening because my object is supposed to be reattached and therefore I must be able to access lazily my properties....

tiggy


Top
 Profile  
 
 Post subject: Re: Reattach an object + LazyInitializationException
PostPosted: Sun May 01, 2016 4:14 pm 
Newbie

Joined: Tue Jun 19, 2007 2:11 pm
Posts: 9
I was wondering if someone has an answer for this?

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.