如何在nhibernate中全局设置超时

fro*_*sty 2 nhibernate

我定期收到以下异常.

System.Data.SqlClient.SqlException:超时已过期.操作完成之前经过的超时时间或服务器没有响应.

我已将以下内容添加到我的条件中以增加超时时间.

 .SetTimeout(180)
Run Code Online (Sandbox Code Playgroud)

1)有没有办法将其添加到我的nhibernate配置中,以便180是默认时间?

2)增加超时的后果是什么?这会增加或减少死锁的可能性吗?

Col*_*e W 6

command_timeout - 指定NHibernate生成的IDbCommands的默认超时

取自表3.1.http://www.nhforge.org/doc/nh/en/index.html#configuration-hibernatejdbc中的 NHibernate ADO.NET属性