NHibernate:如何设置连接超时

编程入门 行业动态 更新时间:2024-10-27 19:20:48
本文介绍了NHibernate:如何设置连接超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在NHibernate中发生连接失败(连接超时)之前,是否有任何方法可以全局等待建立连接到给定数据库的时间?在ADO.NET中,您可以为单个连接执行以下操作:

Is there any way to globally setup time you would wait for connecting to a given database, before a connection failure in NHibernate (connection timeout)? In ADO.NET you can do it for a single connection like this:

new SqlConnection().ConnectionTimeout = 10;

我发现了如何设置命令执行失败之前等待结果集的时间此处(命令超时).但是,显然,这不是我所需要的

I found how to setup the time you would wait for a result set, before a command execution failure here (command timeout). But, apparently, that's not what I need

推荐答案

您可以在连接字符串"Connection Timeout = x"上进行设置.

You can set it on the connection string, "Connection Timeout=x".

更多推荐

NHibernate:如何设置连接超时

本文发布于:2023-10-16 06:13:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何设置   NHibernate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!