how can I handle Out Of Memory in 50million record nhibernate, I used stateless sessions in NHibernate and solve around ~1.7 million records but its not good for my report. and another thing is I need to calculate on them so I can't take apart the result. Could you let me know how to optimize it?
public IEnumerable<ATMDispenseReport> GetReport(string WhereClause)
{
var CurrentUnitOfWork = this.UnitOfWork as MainUnitOfWork;
var session = CurrentUnitOfWork.StatelessSession;
string SqlQuery = "MyQuery";
var lstATMDispenseReport =session.CreateSQLQuery(SqlQuery) .SetResultTransformer(Transformers.AliasToBean<ATMDispenseReport>())
.List<ATMDispenseReport>();
return lstATMDispenseReport;
}
Edit: Final Solution was using DBMS to handle the query calculation.