Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make UnitOfWork not implement IDisposable #73

Merged
merged 8 commits into from
Nov 6, 2024

Conversation

mvarendorff2
Copy link
Member

@mvarendorff2 mvarendorff2 commented Nov 5, 2024

Having the UnitOfWork implement IDisposable caused many issues, leaks and odd multi-threading chaos. We thus make returning the UnitOfWork to the pool explicit which should not cause too much implementation overhead in the vast majority of use-cases. Calling unitOfWork.Return() will be required now however after using serviceProvider.GetSystemUserUnitOfWork() or serviceProvider.GetUserUnitOfWork(userId).

After this is merged, we can also have more confidence in upgrading to HC@14 in #67 (+ required changes).

@mvarendorff2 mvarendorff2 force-pushed the fix/unit-of-work-not-disposable branch from ac3a5ca to 34e6329 Compare November 5, 2024 08:13
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 81.96721% with 11 lines in your changes missing coverage. Please review.

Project coverage is 86.30%. Comparing base (eb68f68) to head (4584383).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/Fluss.HotChocolate/AddExtensionMiddleware.cs 52.94% 6 Missing and 2 partials ⚠️
src/Fluss/UnitOfWork/UnitOfWorkFactory.cs 91.30% 0 Missing and 2 partials ⚠️
src/Fluss/UnitOfWork/UnitOfWorkRecordingProxy.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
+ Coverage   80.64%   86.30%   +5.65%     
==========================================
  Files          83       83              
  Lines        3731     3732       +1     
  Branches      375      376       +1     
==========================================
+ Hits         3009     3221     +212     
+ Misses        648      418     -230     
- Partials       74       93      +19     

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

@mvarendorff2 mvarendorff2 marked this pull request as ready for review November 5, 2024 08:35
@mvarendorff2 mvarendorff2 changed the title Fix/unit of work not disposable Make UnitOfWork not implement IDisposable Nov 5, 2024
@Enterprize1 Enterprize1 enabled auto-merge (rebase) November 6, 2024 10:08
@Enterprize1 Enterprize1 force-pushed the fix/unit-of-work-not-disposable branch from 7b48450 to 4584383 Compare November 6, 2024 10:09
@Enterprize1 Enterprize1 removed the request for review from ThorstenThiel November 6, 2024 10:09
@Enterprize1 Enterprize1 merged commit e00f0b7 into main Nov 6, 2024
5 checks passed
@Enterprize1 Enterprize1 deleted the fix/unit-of-work-not-disposable branch November 6, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants