You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need obvious way to check outright if a Transaction has been completed. #985
Had an issue where a fill on a NamedDataSet was failing with the following exception: System.InvalidOperationException: Inconvertible type mismatch between SourceColumn. This caused a rollback in either the NpgsqlDataAdapter or the DbDataAdapter without touching any of my code.
When my code tried rolling back the connection due to the exception, I was getting a: System.InvalidOperationException: This NpgsqlTransaction has completed; it is no longer usable.
Looking in the code, the only way to avoid a double rollback issue would be to check if the connection object is null on the transaction. This is non-obvious; so, I propose a property called IsCompleted be added to the transaction which performs this operation, and CheckCompleted() to be updated to use this new property.
I have made the changes and will be submitting a pull request and also added tests referencing this issue.
Activity
roji commentedon Mar 29, 2016
Merged into 3.0.6 and 3.1.
roji commentedon Apr 4, 2019
Note that I'm proposing removing the IsCompleted property for 4.1, as part of #2416.