Sign in to follow this  
Tano_ITA

A Database question..

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this