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: Check for lazy loaded collections
PostPosted: Fri Oct 17, 2003 9:36 am 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
Is there a way of checking if a classes' collections have been loaded or not when lazy loading is set? I need to do this check outisde the session as we have functions that need to work differenctly depending on whethter these collection have been loaded or not and currently they are throwing exceptions


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2003 10:16 am 
Regular
Regular

Joined: Tue Aug 26, 2003 3:34 pm
Posts: 54
Location: Farroupilha - Brasil
Hello,
Try to use Hibernate.isInitilized(Object)

[url]file:///D:/var/java-refs/hibernate-2.0.2/doc/api/net/sf/hibernate/Hibernate.html#isInitialized(java.lang.Object)[/url]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2003 10:20 am 
Regular
Regular

Joined: Tue Aug 26, 2003 3:34 pm
Posts: 54
Location: Farroupilha - Brasil
Ops ... sorry by the url ...

http://www.hibernate.org/hib_docs/api/net/sf/hibernate/Hibernate.html#isInitialized(java.lang.Object)

:-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2009 5:27 am 
Newbie

Joined: Thu Nov 15, 2007 3:17 am
Posts: 19
This works well when session is closed, but Im curious that the result is true everytime when there is an active session attached!? Is there any way to check if collection is lazy when session on collection is not null?


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.