Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for advice on when to open and close connections 1

Status
Not open for further replies.

jojo11

Programmer
Feb 2, 2003
189
US
I have an app that does does internet research. THe initial log in logs the user into the login history which is stored on our ISP's SQL server database. We distribute this through our web site and sell it as a local app. We give them a user name and password so they can log in. Besides that initial login, they probably will need to access the ISP database maybe 10 times every 15 minutes to update their usage and minor things like that. I am wondering if I should leave the connection open the entire time the app is open and just make calls to the DB through that or actually close the connection after each call.
Any opinions?
 
Hello,

There're two ways :
- The first is about money !!! If you pay your database license depending connection, you must open/close each time you need retreive informations.

- The second is technical, you should'nt open/close your connection each time, indeed, It's one of the more expensive job to your prog. It must negociate, open a socket, wait the answer of the database and many more...

So, just considerate the technical way, let the connection open and setup you database with a pool of connections with auto-close option : if there's no activity during laps of time then close the connection.


See you...

SEB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top