[Qt-interest] qtsql simultaneous queries to db
Bill King
bill.king at nokia.com
Fri Feb 12 02:10:50 CET 2010
On 02/12/2010 02:14 AM, ext franki wrote:
> Hi,
>
> I need to run another query, during fetching result from QSqlQuery, something
> like this:
>
> q=QSqlQuery;
> q.exec("select somethig from table");
> while(q.next()) {
> // need run another query to calculate some values
> //....
> }
>
> Is it possible with one connection to db? For example to create another
> QSqlQuery object and call q1.exec() and so one, during reading from previous
> QSqlQuery?
> Or do I need separate connections to run simultaneously queries?
>
> I have qt4.5 and postgresql 8.1
>
> Greetings
> Marek
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
So long as you stay in the same thread, we've placed no limits on the
number of queries you can open simultaneously on the one DB connection.
On threads tho, you mileage may vary, but it's usually a good idea to
have a DB connection per-thread.
Also, please note, sqlite's quite multi-thread/multi-process
antagonistic. It's gotten better of late, but it's still a long way from
optimal.
--
Bill King, Software Engineer
Qt Development Frameworks, Nokia Pty Ltd
Brisbane Office
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100212/bf170ecd/attachment.html
More information about the Qt-interest-old
mailing list