-->
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: For lazy-fetched collections, what should debugger show?
PostPosted: Tue May 06, 2008 10:50 am 
Regular
Regular

Joined: Thu Nov 30, 2006 10:48 am
Posts: 59
PropVal has a 1-M association with PropValHistory; PropVal has an IList<PropValHistory> History property. PropValHistory collection is specified as lazy fetch in the class mapping for PropVal. What should I see in the debugger when I do a get-by-id for PropVal? I currently see the nHib wrapper collection object filled with PropValHistory objects; does the debugger's access of the History collection result in the wrapper collection object being accessed and the select being run?

Thx,
Bill

_________________
metazone


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 07, 2008 5:18 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
Yes, examining proxies in the debugger will cause them to be initialized. If it makes a difference to what you are debugging, don't have the Locals or Autos windows visible, and be careful about what objects you examine.

In the Immediate window or the Watch window, you can do
Code:
NHibernate.NHibernateUtil.IsInitialized(myEntityOrCollection)

first if you're not sure whether the entity/collection is initialized or not, and wait until it is initialized before examining it any further if that matters to what you're trying to debug.


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.