views:

51

answers:

1

I have dependent and independent classes, I need to create database connections in these classes. As I understand from Qt documentation, if I create connections in default way, all of them use same connection.

Should I create different database connections for different classes, or should I use same database connection. What are pros and cons? Thanks.

+1  A: 

I'm not sure why @Dummy00001 logged his response as a comment rather than an answer, but I concur with him. If you aren't going to be working with the database in a parallel fashion, you don't need multiple connections, and they will, in fact, be wasteful of resources both in your client library and on the server.

Uncle Mikey