[Interest] SQL databases and threading
tony at rightsoft.com.au
Mon Oct 15 06:49:55 CEST 2018
AFAIK, you have to open the QSqlDatabase, do QSqlQuery prepare and exec,
read the results, do the next query, etc. all within one thread. You
can have multiple threads accessing simultaneously, if the underlying
database supports it. But you cannot send the query in one thread, then
read the results in another.
On 12/10/2018 5:52 PM, Konstantin Shegunov wrote:
> Is there any way to tell (besides looking at the sources) if a given
> SQL plugin, or single methods of it, is reentrant/thread safe? The
> docs are rather evasive on the issue ...
> What would be allowed to do if I want to thread the SQL queries? Can I
> serialize the exec/prepare and then pull the resultset in another thread?
> Ideally I would like to process the results in a thread if possible,
> even if I have to serialize the exec.
> Currently I'm working with the PQSQL driver, but general answers are
> acceptable as well.
> Thanks in advance.
> Kind regards.
> Interest mailing list
> Interest at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest