Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Merge | SqlTransaction#3231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
benrr101 merged 14 commits intomainfromdev/russellben/merge/sqltransaction
Mar 24, 2025
Merged

Conversation

benrr101
Copy link
Contributor

Description: In the latest installment of "Ben Tries To Combine Two Projects Into One", we are merging the SqlTransaction class. This is actually a pretty easy merge - there are ~4 methods that need to be merged into a single file in the common project.

The big headache with these are that they use the constrained execution region pattern that only applies to netfx - this means each of these methods have an entirely different set of exception handling for special exceptions that can only happen in netfx constrained execution regions. However, the netcore implementation has a diagnostic listener that expects an exception to be set on it if one occurs. This presents a challenge of how to retain these differences while also making it readable. There are two patterns we could adopt:

  1. All exception handles have a conditional for netcore to set the diagnostic listener eg:
//...catch(OutOfMemoryExceptione){  #ifNETdiagnosticListener.SetException(e)  #endif  _connection.Abort();throw;}catch(ThreadAbortExceptione){// .. repeat from above}catch(Exceptione){  #ifNETdiagnosticListener.SetException(e);  #endifthrow;}
  1. Conditional exception handles for netfx/netcore
#ifNETFRAMEWORKcatch(OutOfMemoryExceptione){_connection.Abort();throw;}catch(ThreadAbortExceptione){// .. repeat from above}#elsecatch(Exceptione){diagnosticListener.SetException(e);throw;}#endif

In my humble opinion, option 2 is somewhat better, and it is the pattern I have adopted in this PR.

The other merge as part of this PR is moving SqlTransaction.Common back into the SqlTransaction file. Thus, no more partial for SqlTransaction. The Common file looks to be an early attempt to merge what could be merged, so since we have reconciled the differences, we can bring them all together again.

Testing: Once again, no functional differences, just code moving around.

@edwardneal Please don't be upset if I sniped your next merge target 😄

edwardneal reacted with laugh emoji
@benrr101benrr101 added the Common Project 🚮Things that relate to the common project project labelMar 19, 2025
@benrr101benrr101 requested a review froma teamMarch 19, 2025 18:48
Copy link
Contributor

@paulmedynskipaulmedynski left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Some comments/questions about preprocessor directives that are likely relevant to this PR. Other comments about existing code/patterns that we could maybe improve upon since we're here already.

@codecovCodecov
Copy link

codecovbot commentedMar 20, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is65.65657% with68 lines in your changes missing coverage. Please review.

Project coverage is 72.78%. Comparing base(33083f3) to head(a693933).
Report is 6 commits behind head on main.

Files with missing linesPatch %Lines
...ent/src/Microsoft/Data/SqlClient/SqlTransaction.cs65.48%68 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3231      +/-   ##==========================================+ Coverage   72.72%   72.78%   +0.06%==========================================  Files         303      301       -2       Lines       59712    59614      -98     ==========================================- Hits        43426    43393      -33+ Misses      16286    16221      -65
FlagCoverage Δ
addons92.58% <ø> (ø)
netcore75.18% <80.71%> (+0.09%)⬆️
netfx71.46% <61.27%> (+0.02%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynskipaulmedynski self-assigned thisMar 21, 2025
@benrr101benrr101 merged commita22bf28 intomainMar 24, 2025
252 checks passed
@benrr101benrr101 deleted the dev/russellben/merge/sqltransaction branchMarch 24, 2025 17:46
@cheenamalhotracheenamalhotra added this to the6.1-preview1 milestoneMar 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@edwardnealedwardnealedwardneal left review comments

@mdaiglemdaiglemdaigle approved these changes

@cheenamalhotracheenamalhotracheenamalhotra approved these changes

@paulmedynskipaulmedynskipaulmedynski approved these changes

@samsharma2700samsharma2700samsharma2700 approved these changes

Assignees

@paulmedynskipaulmedynski

Labels
Common Project 🚮Things that relate to the common project project
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

6 participants
@benrr101@mdaigle@cheenamalhotra@paulmedynski@edwardneal@samsharma2700

[8]ページ先頭

©2009-2025 Movatter.jp