lazy determine the moment when the second query happen.if you use outer-join, lazy has no effect.
Btw I'm never use outer-join attribute, instead I'm using the fetch attribute (it is more clear to me). all is expected behavior. 2009/4/8 Ayende Rahien <[email protected]> > Yes, I expected that when lazy="false" it would be single query for both of > them. > > > On Wed, Apr 8, 2009 at 8:07 AM, Fabio Maulo <[email protected]> wrote: > >> For 2 queries you mean one for the entity and one for the collection ? >> >> 2009/4/7 Ayende Rahien <[email protected]> >> >> I think that I forgot something, but it looks like lazy doesn't really >>> have any meaning anymore for <set>, the important bit seems to be >>> outer-join, rather than lazy. >>> >>> For the following code: >>> >>> using (var session = sessionFactory.OpenSession()) >>> using (var tx = session.BeginTransaction()) >>> { >>> var blog = session.Get<Blog>(1); >>> foreach (var post in blog.Posts) >>> { >>> Console.WriteLine(post.Title); >>> } >>> tx.Commit(); >>> } >>> >>> Here are the number of statements per options >>> >>> lazy outer-join # of SQL statements true auto 2 true true 1 true >>> false 2 false auto 2 false true 1 false false 2 >>> Did I miss anything? >>> >> >> >> >> -- >> Fabio Maulo >> > > -- Fabio Maulo
