Hibernate version: 1.0.2.0
Name and version of the database you are using: SQL Server 2005
I am calling NHibernateUtil.Initialize(parent.Children) where children is a many-to-one on the parent (duh).
Every time I call Initialize, nhibernate issues the query to load the child objects. How can I get it to retrieve them from the 2nd level cache? Caching works as expected in other situations so I have initialized it correctly.
The relevant mapping document looks like this:
Code:
<class name="Test.Parent" table="Parent">
<cache usage="read-write" />
(stuff removed)
<bag name="Children" cascade="all" batch-size="30" lazy="true">
<key column="parentid" />
<one-to-many class="Test.Child,Test" />
</bag>
</class>
Thanks for any help.