Unanswered: cannot set connection timeout in ASP !
In my ASP's I use an ADODB connection to an MS SQL Server 2000. For this specific ASP I need the connection timeout to be AS SHORT AS POSSIBLE so I set the timeout to 1:
connectionDB.ConnectionTimeout = 1
Microsoft's explanation of ConnectionTimeout prop:
" The ConnectionTimeout property specifies the amount of time in seconds to wait for connection initialization to complete."
I thought this meant that the connection attempt would be canceled (and an error raised) .. after the time you specify in seconds...
Well nope .... I can set it to just about anything I want, the timeout only occurs after a minimum of 13 SECONDS !!! (which is way too long for my app in this perticular case).
Only exception: if I set the timeout to 0 it will wait forever (as documented).
What is wrong? Did I misunderstand the purpose of the Timeout prop? Does the software not do what it's supposed to? Am I missing something here?
Please, please tell me ... I really need to be able to find out FAST if the SQL server is available or not ! (assumed ConnectionTimeout was the way to do this)
Many, many thanx !!
P.S. Perhaps I should mention that I display the ConnectionTimeout value in the page to verify it, and it's value IS indeed set to 1 ! Thx.
Script times out and ends in a time-out error.
Even if the script is in another app, it still runs in the context of the script that called it - hence, ScriptTimeout applies for the whole app.
Somehow, this seems logical ....
Can anybody tell me why the Connection.Timeout thing isn't working ??
Any other suggestions, anybody ???
Colleague told me that the 'minimum' delay of 13 secs comes from the lower TCP/IP layers which retry any connection at least 3 times. This can only be modified in registry (TCP/IP protocol parameters) and is of course server-wide (hence, will cause misery). So, no solution there for the connection.Timeout thing.
( Can anyone comment on this theory ?)
I discovered only one way out of this:
use the script time-out in a Transactional script so I can trap the time-out error and go from there.
Some workaround - but if it does the trick I'm happy ..
-> Further comments/tips/hints on this .. very welcome, please !