Page 1 of 1

Database connection pool

PostPosted: Wed Dec 08, 2010 10:27 am
by ruddy32
Hello,
Is there a way to manage a database connection pool?
Thanks

Re: Database connection pool

PostPosted: Thu Dec 09, 2010 8:30 am
by QxOrm admin
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.