Is it safe to use default database connection from different threads? Like this:
bool upSafe(const QString &mig_to, const QString &mig_from) const {
if (!QSqlDatabase::database().transaction()) {
qCCritical(hfCoreMT) << "Failed init database transaction";
return false;
}
if (!up(mig_to, mig_from)) {
QSqlDatabase::database().rollback();
return false;
}
return QSqlDatabase::database().commit();
}
In function up
default QSQLQuery created and executed. Maybe some hints to the right pattern?