It is not. You should create a QObject, move that to a thread, and then work 
with the query inside the thread inside the QObject.

I needed to do massive insertion of financial data and ended up writing a 
request / reply interface. Think QNetworkRequest / Reply and then a dispatcher 
to handle the scheduling of jobs.



From: Interest <[email protected]> on behalf of 
Konstantin Shegunov <[email protected]>
Date: Friday, October 12, 2018 at 8:53 AM
To: Interests Qt <[email protected]>
Subject: [Interest] SQL databases and threading

Hello,
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
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to