• Advertisement
Sign in to follow this  

A Database question..

This topic is 3288 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working with mysql++, and i open and close the connection with DB each time i need a query. So, it's better open and close a connection each time or open a a connection when i start my server and close the connection when i close the server? The only component that dialogue with the database is my server application. Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
Make it robust enough to handle reconnects at any time, but keep a persistent connection for the life time of the server application.
Why waste time establishing a connection if you could always have it open?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement