Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit eae21a1a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Log queries executed in transaction replay

parent 0984f3e2
......@@ -1285,7 +1285,11 @@ QSqlQuery DataStore::retryLastTransaction(bool rollbackFirst)
if (rollbackFirst) {
// In some cases the SQL database won't rollback the failed transaction, so
// we need to do it manually
QElapsedTimer timer; timer.start();
m_database.driver()->rollbackTransaction();
StorageDebugger::instance()->removeTransaction(reinterpret_cast<qint64>(this),
false, timer.elapsed(),
m_database.lastError().text());
}
// The database has rolled back the actual transaction, so reset the counter
......@@ -1326,10 +1330,20 @@ QSqlQuery DataStore::retryLastTransaction(bool rollbackFirst)
++i;
}
query = copiedQuery;
}
QElapsedTimer t; t.start();
if (isBatch) {
res = query.execBatch();
} else {
res = query.exec();
}
if (StorageDebugger::instance()->isSQLDebuggingEnabled()) {
StorageDebugger::instance()->queryExecuted(reinterpret_cast<qint64>(this),
query, t.elapsed());
} else {
StorageDebugger::instance()->incSequence();
}
if (!res) {
// Don't do another deadlock detection here, just give up.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment