Anybody using the Stateless Session? I see that change as a quick win.
I don't complain about the lack of feedback on this post but I am just
curious if a remarkable amount of NHibernate developers use the
Stateless Session and for which use cases it is used.
Is it usually only used for write-only actions?
How do people deal with situations where multiple related entity
classes should be read? (I think the join fetch is ideal for many
cases, isn't it?) Are result transformers used in this case to build
the distinct root entity list?
> > I was experimenting a little with thestatelesssession and the next
> > SQL Server version (will follow in a separate post).
>
> > I found that when eager fetching entities like this...
> > using (var session =
> > sessionFactory.OpenStatelessSession())
> > using (var transaction = session.BeginTransaction())
> > {
> > var list = session.Query<Order>()
> > .FetchMany(a => a.OrderLines)
> > .ThenFetch(p => p.Product).ToList();
> > Assert.AreEqual(2, list.Count(a => a.OrderLines
> > .Any(p => p.Product.Name.Contains("soft"))));
> > }
>
> > ... I get too many aggregate roots in the result, there are duplicate
> > instances for the same entity. For thestatelesssession it might be
> > even more important that the join fetch works as expected because lazy
> > loading is disabled for it.
>
> > With a small modification that would be fixed without the need to use
> > some result transformers. Thestatelesssession uses a temporary