str_mov wrote:
When doing the following
session.CreateQuery("from ObjA oa left join fetch oa.CollectionC cc where cc.Id in (200,201) and oa=:object").SetEntity("object", ObjAInst ).List();
CollectionC keeps uninitialized when no rows are returned from the database. I would expect the collection to be initialized with a length of 0.
It makes it a little hard to "be sure" that the collections is actually initialized..
Can this be confirmed??
Is there anyway in which you can initialize CollectionC with an empty array - when such a situation occurs..
Regards Morten
This happened to me too. My problem was, sometimes I was not expecting a LazyInitializationException. Also, catching that exception is a performance penalty too.
I don't think it's a hard fix in NHibernate though.