Name
sqlite3_get_autocommit() — Get the current transaction mode
Definition
int sqlite3_get_autocommit( sqlite3* db );
-
db A database connection.
- Returns
A nonzero value if the given database connection is in autocommit mode, a zero value if it is not.
Description
This function returns the current transaction mode. A nonzero return value indicates that the given database connection is in autocommit mode, meaning that no explicit transaction is open. A return value of zero means that an explicit transaction is in progress.
If an error is encountered while in an explicit transaction, there may be times when SQLite is forced to roll back the transaction. This function can be used to detect if the rollback happened or not.
See Also
BEGIN TRANSACTION [SQL Cmd, Ap C]
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access