将Linq设置为NHibernate ADO命令超时 [英] Setting Linq to NHibernate ADO Command Timeout
本文介绍了将Linq设置为NHibernate ADO命令超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不是连接超时,而是ado命令的超时。
使用(ISession session = NHibernateHelper.OpenSession(NHibernateHelper.Databases.CarrierCDR))
using(session.BeginTransaction(IsolationLevel.ReadUncommitted))
{
lCdrs =(来自verizon in session.Linq< Domain .Verizon>()
where verizon.Research == true
&& verizon.ReferenceTable == null
order by verizon.CallBillingDate descending
select verizon).ToList() ;
$ b $ div class =h2_lin>解决方案
如果你正在配置你的NHibernate你可以添加这个到配置:
< add key =hibernate.command_timeoutvalue = 0/>
How do I increase the timeout in NHibernate Linq To Sql?
Not the Connection Timeout but the ado command timeout.
using (ISession session = NHibernateHelper.OpenSession(NHibernateHelper.Databases.CarrierCDR))
using (session.BeginTransaction(IsolationLevel.ReadUncommitted))
{
lCdrs = (from verizon in session.Linq<Domain.Verizon>()
where verizon.Research == true
&& verizon.ReferenceTable == null
orderby verizon.CallBillingDate descending
select verizon).ToList();
}
解决方案
if you are configuring your NHibernate session with the web.config you can add this to the config:
<add key="hibernate.command_timeout" value="0" />
这篇关于将Linq设置为NHibernate ADO命令超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文