From 196f920925e4a4c94ad15048f6702a1abc5d6ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Gon=C3=A7alves?= Date: Mon, 19 Jun 2023 19:29:13 +0200 Subject: [PATCH] Look for autocommit status instead of transaction status. --- src/DbConnection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DbConnection.cpp b/src/DbConnection.cpp index 02f2cf9e..cac24ec3 100644 --- a/src/DbConnection.cpp +++ b/src/DbConnection.cpp @@ -113,11 +113,11 @@ int DbConnection::busy_callback_helper(void *data, int num) } bool DbConnection::in_transaction() const { - int status = sqlite3_txn_state(pConn_, NULL); + int status = sqlite3_get_autocommit(pConn_); - if (status == SQLITE_TXN_NONE) { - return false; - } else { + if (status == 0) { return true; + } else { + return false; } }