Setting Linq to NHibernate ADO Command Timeout

一个人想着一个人 提交于 2019-12-10 18:54:54

问题


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();
}

回答1:


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" />



回答2:


The only mention of a command timeout parameter in all of fluent nhibernate's source code is in a FirebirdConfiguration object. Which configures the application for the firebird database, which you are probably not using. I would suggest playing with your configuration objects, and consulting your database's connection string reference.

The Raw function in the PersistenceConfiguration may allow you to access the properties you are looking for, like FirebirdConfiguration, you could add the line Raw("command_timeout", "444");, to where your configure nhibernate.



来源:https://stackoverflow.com/questions/2519754/setting-linq-to-nhibernate-ado-command-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!