It's not a matter of Transaction
itself, although I only use transactions for save/update calls, not selects, but that might be a matter of preference (or I simply don't know something important).
The thing is, you're not 'materializing' the collection before closing the session.
This should work:
var result = session.Query<I>.Where(condition).List();
return result;
The Where
does not do anything by itself. Which means you're just deferring execution of the filter until you do something with it - e.g. iterate over it. If you're out of Session scope by then (and it seems you are), you'll get the exception, since you can't call the database when the session is closed.
Although you probably won't be able to access lazily loaded child items without eagerly Fetch
ing them first - you can't call database through proxy when you're not inside an open session. :)
Disclaimer
By the way, same thing would happen in EF with LINQ:
IEnumerable<I> myObjects;
using(var context = new MyDbContext())
{
myObjects = context.Set<I>.Where(x => x.Name == "Test");
}
foreach(obj in myObjects)
{
var name = obj.Name; //BOOM! Context is disposed.
}