Fix unchecked return value 21/230421/2 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.104419 accepted/tizen/6.0/unified/hotfix/20201102.235534 accepted/tizen/unified/20200410.122736 submit/tizen/20200410.035811 submit/tizen_6.0/20201029.205501 submit/tizen_6.0_hotfix/20201102.192901 submit/tizen_6.0_hotfix/20201103.115101 tizen_6.0.m2_release
authorSangwan Kwon <sangwan.kwon@samsung.com>
Fri, 10 Apr 2020 01:52:11 +0000 (10:52 +0900)
committerSangwan Kwon <sangwan.kwon@samsung.com>
Fri, 10 Apr 2020 01:53:31 +0000 (10:53 +0900)
Change-Id: I39b362b4dc1e4ed4de86abbdd15480bd40b3b2ad
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
src/framework/db/connection.cpp

index ab110e5..a4cdbed 100644 (file)
@@ -16,6 +16,7 @@
 #include <iostream>
 
 #include "db/connection.h"
+#include "common/audit/logger.h"
 #include "common/exception.h"
 
 namespace Csr {
@@ -45,12 +46,14 @@ int Connection::exec(const std::string &query)
 
 void Connection::transactionBegin()
 {
-       ::sqlite3_exec(m_handle, "BEGIN TRANSACTION;", 0, 0, 0);
+       if (::sqlite3_exec(m_handle, "BEGIN TRANSACTION;", 0, 0, 0) != SQLITE_OK)
+               ERROR("Failed to begine transaction: " << getErrorMessage());
 }
 
 void Connection::transactionEnd()
 {
-       ::sqlite3_exec(m_handle, "END TRANSACTION;", 0, 0, 0);
+       if (::sqlite3_exec(m_handle, "END TRANSACTION;", 0, 0, 0) != SQLITE_OK)
+               ERROR("Failed to end transaction: " << getErrorMessage());
 }
 } // namespace Db
 } // namespace Csr