Database connection pool

Forum for posting problems using QxOrm library

Database connection pool

Postby ruddy32 » Wed Dec 08, 2010 10:27 am

Hello,
Is there a way to manage a database connection pool?
Thanks
ruddy32
 

Re: Database connection pool

Postby QxOrm admin » Thu Dec 09, 2010 8:30 am

Hi,

The class "qx::QxSqlDatabase" can be used to set parameters to connect to the database (it's a singleton).
QxOrm library will create automatically a connection per thread.

If you want to manage your own database connection pool, you can do this with QxOrm library.
Indeed, all functions under namespace qx::dao to communicate with database have a parameter "QSqlDatabase * pDatabase" ("QSqlDatabase" is an object of QtSql library, so you can find a documentation) :
- by default this parameter is set to "null" => so QxOrm manages connection to database automatically.
- you can set your own "QSqlDatabase" if you have a connection pool.
QxOrm admin
 


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 9 guests