Repository navigation
Added asynchronous transaction savepoint functions. - #2414
Conversation
YohDeadfall
left a comment
There was a problem hiding this comment.
Looks good, but I don't think that there is need in nested regions like Save Savepoints.
There was a problem hiding this comment.
Why not combine these two with a default argument?
There was a problem hiding this comment.
This is how public API is designed. Take a look at other methods in System.Data or in 'Npgsql'. An explanation of that you can found here.
There was a problem hiding this comment.
Ah, interesting. In that case, please disregard!
There was a problem hiding this comment.
@YohDeadfall it's true that this is how System.Data is currently, but that's pretty old. The corefx guidelines have changed and it's not preferred to have a single method with an optional cancellation token parameter. The same is being adopted in https://github.com/dotnet/corefx/issues/35012, for example (this was communicated orally in a .NET design review meeting).
650783f to
89a4374
Compare
|
Perfect, I went ahead and removed the superfluous nested regions. I have the old commit saved in a branch so if anyone wants them back, I can re-do it. |
roji
left a comment
There was a problem hiding this comment.
Thanks for this, looks good.
One change request from me - please merge together the two async overloads as @austindrenski previously wrote (see my comment below).
There was a problem hiding this comment.
Note that this isn't the right pattern - a cancelled Task should be returned rather than throwing. However, we don't do this correctly in some other async methods, I've opened #2417 to track this separately.
There was a problem hiding this comment.
@YohDeadfall it's true that this is how System.Data is currently, but that's pretty old. The corefx guidelines have changed and it's not preferred to have a single method with an optional cancellation token parameter. The same is being adopted in https://github.com/dotnet/corefx/issues/35012, for example (this was communicated orally in a .NET design review meeting).
89a4374 to
8378f58
Compare
|
Alright how does that look? I went ahead and did it for CommitAsync() and RollbackAsync() as well. Is that return cancelled task how you would like it formatted? Do you think there should be line break in between the if statement and the using? |
|
This is a binary breaking change as some public methods have been removed (overloads of Commit/Rollback without a cancellation token). |
|
Added back the removed overloads for 4.1 only (not 5.0) to prevent the binary break. |
Hey I noticed the asynchronous version of the savepoint functions were missing, so I went ahead and created them and some tests. Let me know if this is unwanted or if you have any suggestions about format / styling etc.
Chris