|
-
Jul 25th, 2008, 08:05 AM
#1
Thread Starter
Fanatic Member
Help with connection timeout?
I need help I'm running an SQL query that sometimes works in about 30-45 seconds but usually times out in about 30 seconds.
Here's my connection string, I set the timeout to 180 (3 minutes), and the server is set to 600, but the web page fails and an exception is thrown 'SQL server timeout', within about 30 seconds.
Is there another setting thats not allowing it to try for the full 180 seconds?
"Server=x.x.x.x;Database=mydb;Uid=MyUser;Pwd=MyPass;Connect Timeout=180;" />
-
Jul 25th, 2008, 08:09 AM
#2
Re: Help with connection timeout?
There issue may be due to your other code etc, as several database connection technologies have their own time-outs in addition to those provided by the database system.
-
Jul 25th, 2008, 01:44 PM
#3
Thread Starter
Fanatic Member
Re: Help with connection timeout?
I'm using .NET 2.0, SQLConnection function.
When I do SqlCn.ConnectionTimeout it displays correctly (180).
Where else might there be a bottleneck that is shortening my timeout?
-
Jul 27th, 2008, 12:14 PM
#4
Re: Help with connection timeout?
Two possibilities:
1. If the data returned from this connection is part of the basic html of your webpage, i.e. the page isn't finished loading until it has this data, then it could very well be that the browser is timing out because if a page hasn't finished loading within a certain amount of time, most browsers will assume that something must be wrong. If this is the case, then you need to load your page first and then run this connection and update a frame on the page perhaps. You could put a little loading gif.
2. Your ISP is forcibly cutting the connection because it's been open too long.
-
Jul 28th, 2008, 12:19 PM
#5
Re: Help with connection timeout?
Are you sure it isn't your command object timing out?
-
Jul 31st, 2008, 02:46 PM
#6
Thread Starter
Fanatic Member
Re: Help with connection timeout?
Thanks, it was the command object that was timing out (before the actual connection ). Setting the command object itself to the same timeout as the connection object fixed the problem.
-
Jul 31st, 2008, 02:47 PM
#7
Thread Starter
Fanatic Member
Re: Help with connection timeout?
This is resolved
(sorry my edit's not working)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|