Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C# MSSQL connection idle timeout.

  • 13-02-2013 2:49pm
    #1
    Registered Users, Registered Users 2 Posts: 7,501 ✭✭✭


    Im connecting to an MSSQL 2005 and 2008 server in my C# project and getting some information.

    Im leaving the connection open until the user closes the program and at that point i close the connection to the database.

    What im trying to find out is if there is a Idle timeout on the server side in MSSQL.

    If the user leaves the program open for a period of time will the server kill the connection? I cant seem to find a definitave answer with google.


Comments

  • Registered Users, Registered Users 2 Posts: 14,716 ✭✭✭✭Earthhorse


    I hate to answer a question with a question but is there a reason you need to persist the connection in this manner?


  • Registered Users, Registered Users 2 Posts: 7,501 ✭✭✭BrokenArrows


    Earthhorse wrote: »
    I hate to answer a question with a question but is there a reason you need to persist the connection in this manner?

    Not really no.

    Ive actually changed it since asking this question to connect/disconnect after every query because i couldnt find a definate answer to the question.


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    You're doing it right now.


  • Registered Users, Registered Users 2 Posts: 7,501 ✭✭✭BrokenArrows


    Whats wrong with persisting a connection anyway?


  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    It hogs resources. What would happen if you had hundreds of clients that all kept their connections open?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,501 ✭✭✭BrokenArrows


    srsly78 wrote: »
    It hogs resources. What would happen if you had hundreds of clients that all kept their connections open?

    Ok fair enough.

    Hadnt really considered that because its not going to happen in my scenario but its probably good practice to close stuff when im done.


Advertisement