NHibernate-流大型结果集? [英] NHibernate - Stream large result sets?

查看:101
本文介绍了NHibernate-流大型结果集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须读入一个大记录集,进行处理,然后将其写到一个平面文件中。

I have to read in a large record set, process it, then write it out to a flat file.

大结果集来自一个存储过程SQL 2000。

The large result set comes from a Stored Proc in SQL 2000.

我目前有:

var结果= session.CreateSQLQuery( exec usp_SalesExtract)。List();

I currently have:
var results = session.CreateSQLQuery("exec usp_SalesExtract").List();

我希望能够逐行读取结果集,以减少内存占用

I would like to be able to read the result set row by row, to reduce the memory foot print

谢谢

推荐答案

NHibernate并非为此用途而设计。另外,您并没有真正使用它的功能。

NHibernate is not designed for that usage. Plus, you're not really using its features.

因此,在这种情况下,最好使用原始ADO.NET。

So, in this case, it's better to use raw ADO.NET.

这篇关于NHibernate-流大型结果集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆