Time out option on DB

  • 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?

  • 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
  • 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 http://connectionstrings.com/ for more even more details, but here's an example:

    Dim mySqlConnectionFormat As String = "

    data source={0};

    initial catalog={1};

    user id={2};

    password={3};

    Trusted_Connection=False;

    Connect Timeout=600;

    Workstation ID=GhostInTheMachine;

    Application Name=HaxxorPadPlusPlus;"

    Lowell


    --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!

  • 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

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply