Skip to content

Commit

Permalink
Look for autocommit status instead of transaction status.
Browse files Browse the repository at this point in the history
  • Loading branch information
bpvgoncalves authored and krlmlr committed Oct 12, 2023
1 parent 53a955e commit 196f920
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DbConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 196f920

Please sign in to comment.