Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Time out option on DB Expand / Collapse
Posted Tuesday, March 19, 2013 1:27 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, November 22, 2016 1:37 PM
Points: 388, Visits: 1,074
There is an app that connects to DB. If user in the app sits idle for 30 mins or so, it automatically disconnects them from DB. App developer says, there is nothing on the app side that he sets to time out and it must be on the DB side. I checked the DB and AutoClose is false. Is there anything else I can check?
Post #1432875
Posted Tuesday, March 19, 2013 2:38 PM



Group: General Forum Members
Last Login: Today @ 10:55 AM
Points: 45,613, Visits: 44,143
That's not a database setting, get the developer to check the app again. SQL won't automatically close connections (I've left connections open for days or weeks)

Only way it can be on the DB side is if there's a job that someone wrote that's killing connections older than a certain age, someone's manually killing connections or the DB or server is restarting on a regular basis.

Also, check the network between client and server, if that has regular drops it could explain the disconnections.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1432899
Posted Tuesday, March 19, 2013 2:46 PM



Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 14,538, Visits: 38,376
have the developer change the application connection string.
both SQLOLEDB and SQLNCLI providers have a default timeout of 30 seconds unless otherwise overridden in the connection string created by the application.

if the connection is from a web server, the web server itself has a session timeout as well; that would explain 20 or 30 minute timeouts better than the connection string.

see for more even more details, but here's an example:

Dim mySqlConnectionFormat As String = "
data source={0};
initial catalog={1};
user id={2};
Connect Timeout=600;
Workstation ID=GhostInTheMachine;
Application Name=HaxxorPadPlusPlus;"


help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1432904
Posted Wednesday, March 20, 2013 2:18 PM



Group: General Forum Members
Last Login: Today @ 3:25 AM
Points: 7,933, Visits: 14,355
I think you are either being killed by a database "sweeper" process (see Gail's response) in which case you can see that in the SQL Error Log (look for "kill" in the entry), or you're running into some kind of session timeout (as opposed to a connect or command timeout). If its a session timeout it could be a web server config (as Lowell mentioned) and I have also seen aggressive firewall policies do things like that too.

There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1433478
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse