SqliteTransaction.Dispose() leaves an orphaned transaction instance in the connection if RollbackInternal() throws
If the underling sqlite provider throws during a call to SqliteTransaction.Dispose(), then SqliteTransaction.Complete() is never called, and the transaction instance is left orphaned in the connection. This prevents any further transactions from being started on the connection.
I expect that the even if SqliteTransaction.RollbackInternal() throws, SqliteTransaction.Complete() is still called to clean up the connection before the exception leaves the Dispose() call frame.
The scenario where this may occur is with removable or network storage, where the storage the database file resides on has been removed or is otherwise unavailable just before a transaction is aborted/disposed for some reason. If access to the storage location is later restored, I would expect to be able to re-use the connection instance to issue new transactions against the database file.
repro project:
SqliteTransactionDisposeRepro.zip
version information
Microsoft.Data.Sqlite version: <= 5.0.7 Target framework: all targets Operating system: all OS