Reputation: 1503
I have got the connection Timeout in DB. Already I have set connection Timeout to '60sec' in DB. I got the below error. After connecting with DB people ,have found that. The below error is not query command timeout and mostly of connection establishing Mule to DB timeout. I have a doubt Here Connection Time= 60sec ( means once it reached DB, time to wait to execute the query). Is it correct.
But then how to increase the connection Time out ?, Going through the link http://www.mulesoft.org/documentation/display/current/Database+Connector+Examples.
Thought to provide maxWaitMillis = 20000 as below. But not sure this is correct ( Because document talks about connection polling and cache, but I dont want cache all over here).
Is it fine, without giving any other value inside connection polling. Just by giving maxWaitMilli timeout is correct for my case or I'm wrong. All I need is need to resolve the below error. Please suggest.
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>
Thanks in advance.
Upvotes: 0
Views: 4869
Reputation: 181
maxWaitMillis attribute in db pooling profile is the number of milliseconds a client calling getConnection() will wait for a Connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefinitely.
The other timeout value is the connection timeout which the amount of time a database connection remains securely active during a period of non-usage before timing-out and demanding logging in again.
Both in the link below: http://www.mulesoft.org/documentation/display/current/Database+Connector+Reference
The query timeout was available in the old jdbc connector (which I assume it will set the JDBC statement queryTimeout attribute) but I cannot find in the new db connector.
http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference
Upvotes: 2