[rc2] Properly handle automatic rollbacks in SQLite in Commit.#36685
[rc2] Properly handle automatic rollbacks in SQLite in Commit.#36685cincuranet merged 1 commit intodotnet:release/10.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes improper handling of automatic rollbacks in SQLite transactions by reordering operations in the Commit() method. The issue occurs when SQLite errors (like SQLITE_FULL) cause automatic rollbacks during commit, leading to confusing exception messages when using using blocks with SqliteTransaction.
Key changes:
- Reorder the rollback hook clearing to occur after the commit operation
- Add explanatory comments about the timing of operations
artl93
left a comment
There was a problem hiding this comment.
RC2.
With this being SQLite, can we add a test for this?
|
@artl93 Adding tests for this is not easy/reliable. One options is to reliably create race condition between multiple threads writing, which I think is a recipe for flaky test. Or for |
Fixes #36561.
Description
Some SQLite errors can cause automatic rollback when errors (i.e.
SQLITE_FULL) occur within a transaction. The waySqliteTransactionhandles this case is incorrect.Customer impact
Using
usingblocks withSqliteTransactionis difficult, because different - confusing - exception is thrown, hiding the original one.How found
Customer reported on M.D.Sqlite 9.
Regression
No.
Testing
Manual testing.
Risk
Low.