Well, I worked around the problem (for now) using this code:
Code:
IEnumerable<Emar.Evaluating.Evaluation> IEmarManager.GetDataSetEvaluations(int questionnaireId)
{
System.Collections.IList evalIds =
Session.CreateQuery("select e.Id from Evaluation e where e.IncludeInDataSet = 1 and e.Questionnaire.Id = ?")
.SetInt32(0, questionnaireId)
.List();
foreach (int evalId in evalIds)
{
Evaluation eval = Get<Evaluation>(evalId);
yield return eval;
Session.Evict(eval);
}
}
This code gets a list of all primary keys, then gets each individual row, and then evicts it. This effectively cuts down on the amount of RAM consumed. However, RAM still creeps up, even if I use ISession.Clear(). This got the job done, but it still took ~1GB of RAM for the query.
Oh, and this is using C# 2.0's
yield return construct.