Nevermore icon indicating copy to clipboard operation
Nevermore copied to clipboard

Allows use of externally owned transactions for writes

Open jimmyp opened this issue 1 year ago • 4 comments
trafficstars

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]

jimmyp avatar Feb 22 '24 03:02 jimmyp

Tagged Cloud PT, https://octopusdeploy.slack.com/archives/C01Q95KPRM4/p1709254205324879

No impact for Cloud PT as they have removed Nevermore from Cloud Portal

michaelongso avatar Mar 01 '24 00:03 michaelongso

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.

gb-8 avatar Mar 01 '24 00:03 gb-8

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

jimmyp avatar Mar 01 '24 02:03 jimmyp