From 427384f7b843a3eeb5fc9c812596433a8ca7234d Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Mon, 11 Mar 2024 13:49:28 +0800 Subject: [PATCH] fix(app-database-service):do not start a transaction while setting app to favourites. --- ukui-search-app-data-service/app-db-manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ukui-search-app-data-service/app-db-manager.cpp b/ukui-search-app-data-service/app-db-manager.cpp index 3a82525..06e1b10 100644 --- a/ukui-search-app-data-service/app-db-manager.cpp +++ b/ukui-search-app-data-service/app-db-manager.cpp @@ -791,6 +791,9 @@ bool AppDBManager::handleFavoritesStateUpdate(const QString &desktopFilePath, co ApplicationInfoMap infos; //更新favorites状态 + if (!this->startTransaction()) { + return false; + } cmd = QString("UPDATE APPINFO SET MODIFYED_TIME='%0', FAVORITES=%1 WHERE DESKTOP_FILE_PATH=:desktopFilePath") .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")) .arg(num);