-->
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.  [ 4 posts ] 
Author Message
 Post subject: Lazy Loading by default in 3 Beta?
PostPosted: Wed Dec 29, 2004 3:39 am 
Newbie

Joined: Tue Sep 14, 2004 11:18 am
Posts: 10
When I changed from 3 Alpha to 3 Beta all my code broke because of lLazyInitializationExceptions. I don't use lazy loading (on intention). I do have the same problem as discussed in the thread "Hibernate LazyInitializationException". I load an object, I close the session, then I want to access the attributes and get the exception. Leaving the session open solves this, but I don't want to leave all those sessions dangling around.
Then I tried to disable it by setting:
class name="de.stephanwiesner.hibernate.basis.Book" table="BOOKS"
lazy="false"
This did not help either.

So, is there a way to generally disable lazy loading in Hibernate 3 Beta?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 3:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
This is one of the changes in H3 that were made because 99% of our users gets bitten by the direct opposite - that their application loads in their whole db and performance is out the window.

I don't think we have a "global switch", so you'll have to go say lazy="false" on all your relatios (but then again you can't have that big a model since you can live with lazy loading disabled or ?)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: lazy=true works
PostPosted: Wed Dec 29, 2004 4:04 am 
Newbie

Joined: Tue Sep 14, 2004 11:18 am
Posts: 10
Okay, thanks. My code works now, when I set lazy=true on all classes and subclasses. You are right, it is just a tiny demo application.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 29, 2004 4:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you do mean lazy=false right ? ,)

_________________
Max
Don't forget to rate


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