-->
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: How to check if collection or object is lazy loaded?
PostPosted: Mon Mar 29, 2010 11:18 am 
Newbie

Joined: Fri Mar 19, 2010 12:29 pm
Posts: 12
I tried to do something like this:
Code:
try
{
    employeers.size();
}
catch(LazyInitializationException e)
{
    employeers = ... //initialization
}

But LazyInitializationException still appears in console.

So how to check if sime collection or object is lazy loaded correctly?


Top
 Profile  
 
 Post subject: Re: How to check if collection or object is lazy loaded?
PostPosted: Thu Apr 01, 2010 6:19 am 
Newbie

Joined: Fri Mar 19, 2010 12:29 pm
Posts: 12
So there is no any thoughts or ideas?


Top
 Profile  
 
 Post subject: Re: How to check if collection or object is lazy loaded?
PostPosted: Thu Apr 01, 2010 6:56 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
org.hibernate.Hibernate.isInitialized(Object) checks if a proxy or collection has been initialized or not.


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.