Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt qsqlquery. Is exec() sync or async?

Tags:

qt

firebird

I'm using firebird embedded db with Qt provider. For working with db I use qsqlquery::exec() function. Is this function sync or async?

like image 860
Alexandr Derkach Avatar asked May 23 '26 06:05

Alexandr Derkach


1 Answers

QSqlQuery::exec() is blocking (synchronous) but not atomic, the OS can interrupt the thread and run another thread inbetween.

Note that you shouldn't share a single database connection across threads anyway, so there shouldn't be problems.

like image 150
t3ft3l--i Avatar answered May 26 '26 06:05

t3ft3l--i



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!