Nevermore
Nevermore copied to clipboard
Allows use of externally owned transactions for writes
Nevermore already had the concept of accepting an external transaction to use for reads. This PR extends that behaviour to writes.
Commit() was renamed to TryCommit() to convey that it can now throw an exception if the externally provided transaction has already been committed elsewhere. This caused a lot of noise in the tests but I think the rename is valuable otherwise this would be a breaking change.
[sc-71481]
Tagged Cloud PT, https://octopusdeploy.slack.com/archives/C01Q95KPRM4/p1709254205324879
No impact for Cloud PT as they have removed Nevermore from Cloud Portal
Commit() was renamed to TryCommit() to convey that it can now throw an exception if the externally provided transaction has already been committed elsewhere.
I'm not following this. Previously Commit() would throw an exception if the SQL transaction was externally owned. Now it just silently does nothing. That is a breaking change.
The new TryCommit() will throw for externally owned SQL transactions, like the old Commit() method - it won't even get as far as finding out if the externally owned SQL transaction has already been committed.
I'm confused.
Previously Commit() would throw an exception if the SQL transaction was externally owned.
You are totally right, I got myself confused while trying to use the MS convention on TryXXX methods... To not make this a breaking change I'll have to not use this convention
This pull request has been linked to Shortcut Story #71481: Get agreement with PET regarding shared transaction between NSB and Nevermore.