如何增加数据库连接超时
How to increase the DB connection Timeout
我在数据库中遇到连接超时。我已经在数据库中将连接超时设置为“60sec”。我收到以下错误。在与 DB 人员联系后,发现了这一点。以下错误不是查询命令超时,主要是建立 Mule 到 DB 的连接超时。我有个疑问
这里 Connection Time= 60sec (意味着一旦它到达数据库,等待执行查询的时间)。对吗
但是接下来怎么增加连接超时时间呢?,经历了link
http://www.mulesoft.org/documentation/display/current/Database+Connector+Examples。
想提供 maxWaitMillis = 20000 如下。但不确定这是正确的(因为文档讨论了连接轮询和缓存,但我不想在这里到处都是缓存)。
可以吗,在连接轮询中没有给出任何其他值。仅通过给 maxWaitMilli 超时对我的情况是正确的,否则我错了。我只需要解决以下错误。请提出建议。
Error:java.sql.SQLException: Cannot get connection for URL jdbc:sqlserver://c01.company.com;database=**;user=***;password=***** : The TCP/IP connection to the host 01.company.com, port 022 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". (org.mule.module.db.internal.domain.connection.ConnectionCreationException). Message payload is of type: String
<db:generic-config name="DB" url="${db}"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
doc:name="Generic Database Configuration" connectionTimeout="60">
<db:pooling-profile maxWaitMillis="20000"/>
</db:generic-config>
<db:stored-procedure config-ref="DB" doc:name="GetOrderXML">
<db:parameterized-query><![CDATA[{call GetDetailXML('10', ?)}]]></db:parameterized-query>
<db:in-param name="ln" type="CHAR" value="#[flowVars['ID']]"/>
</db:stored-procedure>
提前致谢。
db 池配置文件中的 maxWaitMillis 属性是调用 getConnection() 的客户端在池耗尽时等待签入或获取连接的毫秒数。零意味着无限期地等待。
另一个超时值是连接超时,即数据库连接在超时和要求再次登录之前未使用期间保持安全活动的时间。
都在下面的 link 中:
http://www.mulesoft.org/documentation/display/current/Database+Connector+Reference
查询超时在旧的 jdbc 连接器中可用(我假设它将设置 JDBC 语句 queryTimeout 属性)但我在新的数据库连接器中找不到。
http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference
我在数据库中遇到连接超时。我已经在数据库中将连接超时设置为“60sec”。我收到以下错误。在与 DB 人员联系后,发现了这一点。以下错误不是查询命令超时,主要是建立 Mule 到 DB 的连接超时。我有个疑问 这里 Connection Time= 60sec (意味着一旦它到达数据库,等待执行查询的时间)。对吗
但是接下来怎么增加连接超时时间呢?,经历了link http://www.mulesoft.org/documentation/display/current/Database+Connector+Examples。
想提供 maxWaitMillis = 20000 如下。但不确定这是正确的(因为文档讨论了连接轮询和缓存,但我不想在这里到处都是缓存)。
可以吗,在连接轮询中没有给出任何其他值。仅通过给 maxWaitMilli 超时对我的情况是正确的,否则我错了。我只需要解决以下错误。请提出建议。
Error:java.sql.SQLException: Cannot get connection for URL jdbc:sqlserver://c01.company.com;database=**;user=***;password=***** : The TCP/IP connection to the host 01.company.com, port 022 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". (org.mule.module.db.internal.domain.connection.ConnectionCreationException). Message payload is of type: String
<db:generic-config name="DB" url="${db}"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
doc:name="Generic Database Configuration" connectionTimeout="60">
<db:pooling-profile maxWaitMillis="20000"/>
</db:generic-config>
<db:stored-procedure config-ref="DB" doc:name="GetOrderXML">
<db:parameterized-query><![CDATA[{call GetDetailXML('10', ?)}]]></db:parameterized-query>
<db:in-param name="ln" type="CHAR" value="#[flowVars['ID']]"/>
</db:stored-procedure>
提前致谢。
db 池配置文件中的 maxWaitMillis 属性是调用 getConnection() 的客户端在池耗尽时等待签入或获取连接的毫秒数。零意味着无限期地等待。
另一个超时值是连接超时,即数据库连接在超时和要求再次登录之前未使用期间保持安全活动的时间。
都在下面的 link 中: http://www.mulesoft.org/documentation/display/current/Database+Connector+Reference
查询超时在旧的 jdbc 连接器中可用(我假设它将设置 JDBC 语句 queryTimeout 属性)但我在新的数据库连接器中找不到。
http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference