After upgrading to NH 3.2.0.4000 we now get an exception here because
orderDates is null.

   foreach (var orderDate in orderDates)

It's declared thusly:

   protected IList<OrderDate> orderDates = new List<OrderDate>();

And mapped like this:

   <bag name="orderDates" access="field.camelcase" inverse="true"
lazy="true" cascade="all-delete-orphan" >
       <key column="OrderId" />
       <one-to-many class="OrderDate" />
   </bag>

A few frames down in the stack trace is:

   at NHibernate.Proxy.DefaultLazyInitializer.Intercept(InvocationInfo
info)

There are no matching order date rows in the database.

Why is NH  lazy initializing this collection to null instead of
empty?  How can I fix?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to