-->
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: What could make lazy doesn't work?
PostPosted: Fri Feb 17, 2006 3:54 pm 
Newbie

Joined: Thu Apr 22, 2004 12:59 pm
Posts: 10
Location: RS/Brazil
Hi. My mapping collections are lazy="true", or without lazy that defaults to true, but the collections are eagerly fetched. Debugging, I don't see any proxies in my collections and all are fully initialized. Even closing the session I can navigate through. I'm using Session.get(). If using collections and session is closed I would get LazyInitializationException, don't? What more can I search for?

Hibernate version:
3.1.1

_________________
-
Marcos Vinicius Dufloth
Cyber, Ltda
Erechim - RS - Brasil


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 17, 2006 7:03 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 7:38 pm
Posts: 25
if you want to load child record when parent table loads then,

use <lazy="false">

all data will be loaded at a time.


if <lazy="true"> then you have to manually load the collection .

for eg:

Parent parent = dao.getParent();
Childern children = parent.getChildern().size();


try this.


note:Dont forget to rate yes/no, anyone.


Top
 Profile  
 
 Post subject: What could make lazy doesn't work?
PostPosted: Mon Feb 20, 2006 7:32 am 
Newbie

Joined: Thu Apr 22, 2004 12:59 pm
Posts: 10
Location: RS/Brazil
You don't understand my question. I know what is lazy or non lazy. I'm using lazy="true" and hibernate behavior is like lazy="false".

My question is: What can make hibernate don't proceed correctly if I using lazy="true" and his behavior is like lazy="false"?


gopal wrote:
if you want to load child record when parent table loads then,

use <lazy="false">

all data will be loaded at a time.


if <lazy="true"> then you have to manually load the collection .

for eg:

Parent parent = dao.getParent();
Childern children = parent.getChildern().size();


try this.


note:Dont forget to rate yes/no, anyone.

_________________
-
Marcos Vinicius Dufloth
Cyber, Ltda
Erechim - RS - Brasil


Top
 Profile  
 
 Post subject: What could make lazy doesn't work? (Solved!)
PostPosted: Mon Feb 20, 2006 8:42 am 
Newbie

Joined: Thu Apr 22, 2004 12:59 pm
Posts: 10
Location: RS/Brazil
I was using .get()... but get don't load proxies.... I change to .load() and works.

Why? This is documented somewhere? I saw after debugging hibernate sources....

Anyway, tanks to the answers.

_________________
-
Marcos Vinicius Dufloth
Cyber, Ltda
Erechim - RS - Brasil


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.