locked
open connection to sql server RRS feed

  • Question

  • Hello Experts,

    What is better, open connection in main and leave it open throughout or open connection every time when needed to fetch remote data adding ca etc.

    regards

    Tariq Iftikhar

    Friday, May 6, 2011 4:29 AM

Answers

  • Technically I do open a connection at application start and keep it alive throughout the application life time. This works without problems. As users do query and save data very often, there is no need to close and reconnect all the time, I even don't do that in idle times. And this is for ~500 concurrent users.

    One thing that may be a limitation is a connection limit to a server, but nowadays even in sql express you don't have such a connection restriction any more, you only have a database size restirction. And with a enterprise database you also rather have per server cpu license costs.

    Also in the event you need to cut off users, eg to detach a database or anything needing users out, you can do that on the server side. So also from that persepctive there is no need to close connections.

    Bye, Olaf.

    Friday, May 6, 2011 8:12 AM

All replies

  • Technically I do open a connection at application start and keep it alive throughout the application life time. This works without problems. As users do query and save data very often, there is no need to close and reconnect all the time, I even don't do that in idle times. And this is for ~500 concurrent users.

    One thing that may be a limitation is a connection limit to a server, but nowadays even in sql express you don't have such a connection restriction any more, you only have a database size restirction. And with a enterprise database you also rather have per server cpu license costs.

    Also in the event you need to cut off users, eg to detach a database or anything needing users out, you can do that on the server side. So also from that persepctive there is no need to close connections.

    Bye, Olaf.

    Friday, May 6, 2011 8:12 AM
  • Thanks Olaf Doschke,

     

    Friday, May 6, 2011 4:03 PM