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

feat: prevent using SQL modules with the NoopTransactionContext #4326

Conversation

paullatzelsperger
Copy link
Member

What this PR changes/adds

throws an error when the SQL modules, in particular sql-core is on the classpath, but no TransactionContext implementation (other than NoopTransactionContext) was provided.

Why it does that

avoid pitfalls, where downstream projects have to explicitly add the transaction-local module, but there is no warning if they don't do that.
In those cases, there could be sporadic exceptions thrown by the connection pool

Further notes

List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.

Linked Issue(s)

Closes # <-- insert Issue number if one exists

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@paullatzelsperger paullatzelsperger added the enhancement New feature or request label Jul 3, 2024
Copy link
Member

@ndr-brt ndr-brt left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.24%. Comparing base (7f20ba5) to head (fd51b46).
Report is 340 commits behind head on main.

Files Patch % Lines
...ain/java/org/eclipse/edc/sql/SqlCoreExtension.java 33.33% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4326      +/-   ##
==========================================
+ Coverage   71.74%   75.24%   +3.50%     
==========================================
  Files         919     1053     +134     
  Lines       18457    21139    +2682     
  Branches     1037     1183     +146     
==========================================
+ Hits        13242    15907    +2665     
+ Misses       4756     4714      -42     
- Partials      459      518      +59     

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

@paullatzelsperger paullatzelsperger force-pushed the feat/prevent_sqlmodules_with_noop-tx-context branch from aab29bb to fd51b46 Compare July 5, 2024 05:32
@paullatzelsperger paullatzelsperger merged commit 2cf9bf2 into eclipse-edc:main Jul 5, 2024
22 checks passed
@paullatzelsperger paullatzelsperger deleted the feat/prevent_sqlmodules_with_noop-tx-context branch July 5, 2024 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants