We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef513bd commit 0acfafcCopy full SHA for 0acfafc
src/Microsoft.Data.Sqlite.Core/SqliteTransaction.cs
@@ -83,8 +83,11 @@ public override void Commit()
83
throw new InvalidOperationException(Resources.TransactionCompleted);
84
}
85
86
- sqlite3_rollback_hook(_connection.Handle, null, null);
+ // Do commit first and then clear the rollback hook.
87
+ // Commit itself can fail (i.e. SQLITE_FULL) and then Dispose would throw
88
+ // confusing "SQLite Error 1: 'cannot rollback - no transaction is active'" exception.
89
_connection.ExecuteNonQuery("COMMIT;");
90
+ sqlite3_rollback_hook(_connection.Handle, null, null);
91
Complete();
92
93
0 commit comments