Hi,
First of all thanks for the reference. I'm facing now a problem trying to use the lazy-fetched collection.
I've defined:
Code:
<bag name="SolutionGroups" table="..." lazy="true" cascade="none">
<key column="..." />
<many-to-many class="..." column="..." />
</bag>
In order to Initialize it within my Session I've tryied:
Code:
NHibernateUtil.Initialize(returnValue.SolutionGroups);
I've also tryied to initialize each element within the collection. Using NHibernateUtil.IsInitialize for the list I got true (within Session).
The problem is, after closing the session and try to use the collection (on my presentation layer)
Code:
IList solutionGroups = user.SolutionGroups;
for (int i = 0; i < solutionGroups.Count; i++)
{...
I still recieve the LazyInitializationException. Debugging it I could check IsInitialize returns me
false there, altought it was initialize before (and IsInitialize had returned true).
What have I missed?
Thanks!