Hi,
I created a config with settings as in
var config = {
user= 'guest',
password= 'xxxx',
server= 'localhost\myDB',
connectionTimeout: 300000,
idleTimeoutMillis: 300000,
requestTimeout: 300000,
max: 100
}
I am able to connect and get data for other queries. When I tried accessing a relatively large data set I see that the request times out.
Even though I set the requestTimeout to 300000 as in the above config variable to connect using
service_config.sql.connect(service_config.config, function(err) {聽聽....}
I get Timeout: Request failed to complete in 15000 ms.
I tried printing out the variable just before connecting and I see that it is 300000.
Did I miss out on anything or is requestTimeout not effective.
Please help.
Thanks,
Vijay
First of all, you config is bad. It should look like this:
var config = {
user: 'guest',
password: 'xxxx',
server: 'localhost\myDB',
connectionTimeout: 300000,
requestTimeout: 300000,
pool: {
idleTimeoutMillis: 300000,
max: 100
}
}
A have also added a new test to the repo proving that requestTimeout is functional. Could you please provide more info about you env? SQL Server version, node-mssql version etc. Thanks.
Thank you for correcting the bad config I had.
Details of the environment I am using are:
SQL Server: Microsoft SQL Server 2008 R2 (RTM)
Developer Edition (64-bit) on Windows NT 6.1
nodejs: v0.10.28
I changed config to the suggested format and I get the same error message. (Timeout: Request failed to complete in 15000 seconds).
It works fine , when I make only one request at a time.
It is timing out with (ETIMEOUT) when I make multiple (2 or more requests) sql connect requests almost simultaneously (through multiple webservice calls which in turn call sql.connect with the mentioned config).
Thanks & Best Regards,
Vijay
What version of node-mssql are you using?
I installed it using npm install and I see it as [email protected].
Just update it to latest version 1.1.1 and everything should work as expected.
Talk about great timing with this conversation... Updating from 0.5.3 to 1.1.1 fixed it for me. Thanks!
Sorry for the trouble. Just did that. There was an issue with my package.json which was installing the older version. It works as expected now.
Thanks a lot.
Thanks man !!!! @patriksimek
Using [email protected]...my config object looks like this...
module.exports = {
user: 'user',
password: 'pass',
server: 'server',
database: 'database',
connectionTimeout: 999999999,
requestTimeout: 999999999
};
Yet I am gettig this error on the longer queries (shorter queries work fine):
{ [RequestError: Timeout: Request failed to complete in 15000ms]
name: 'RequestError',
message: 'Timeout: Request failed to complete in 15000ms',
code: 'ETIMEOUT',
number: 'ETIMEOUT',
lineNumber: undefined,
state: undefined,
class: undefined,
serverName: undefined,
procName: undefined,
precedingErrors: []
}
Little late but I keep the default connectionTimeout (good to know when db is down) and add requestTimeout: 0 for long requests/streams
Thanks, saved my life!
Most helpful comment
First of all, you config is bad. It should look like this:
A have also added a new test to the repo proving that requestTimeout is functional. Could you please provide more info about you env? SQL Server version, node-mssql version etc. Thanks.