设置隐式 ToList() 调用的 NHibernate 超时值

发布于 2024-12-10 07:32:29 字数 337 浏览 3 评论 0原文

我有超过 600 万行的表,需要进行选择。当这是工业开发时,我们的开发数据库有数千条记录,而不是数百万条,以下内容很好:

 var results = ( from e in DomainRepo where e.ESIID == esiId select e ).ToList();

所以现在这是 6+000000 个超时的炸弹。是否可以像这样设置 LINQ 调用的超时?或者这必须在 HHib 配置中吗?在另一个地方,我触摸了我正在使用 QBE 的数据,因为已经完成了过滤,所以没有设置超时,但这是一个直接的 ID 调用,除了超时之外,对于上述内容来说似乎很完美。

谢谢。

I have table with 6+ million rows and need to select. When the this was ind development our dev database has thousands of records, not millions and the following was fine:

 var results = ( from e in DomainRepo where e.ESIID == esiId select e ).ToList();

So now that this is 6+ million this bombs with a timeout. Is it possible to set the timeout on a LINQ call like this? Or does this have to be at the HHib config? In the other place I touch the data I'm using QBE without a timeout set because of the filtering being done, but this is a straight ID call which seems perfect for the above above, except for the timeout.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

硬不硬你别怂 2024-12-17 07:32:29

我建议对结果进行分页而不是增加超时,即使您需要所有行(一些批处理?),使用 Take /Skip 方法会照亮整个架构。

I would suggest to page the result instead of incresing the timeout, even if you need all the rows ( some batch processing ? ) use a Take /Skip approach would light the whole architecture.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文