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

Fix @Transactional invalid cases #4551

Merged
merged 13 commits into from
Sep 11, 2022
Merged

Fix @Transactional invalid cases #4551

merged 13 commits into from
Sep 11, 2022

Conversation

ksice
Copy link
Contributor

@ksice ksice commented Sep 5, 2022

What's the purpose of this PR

Fix @Transactional invalid,@transcation has some invalid cases.

E.G.
image

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

@@ -41,7 +41,7 @@ List<Audit> find(String owner, String entity, String op) {
}

@Transactional
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is no need to add a transaction here, because if the execution fails, the database will not be updated successfully, which is equivalent to automatically rolling back the transaction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes,If there is only one database update I think it can be removed,But I found that he originally added transcation so didn't remove it

@@ -51,7 +51,7 @@ void audit(String entityName, Long entityId, Audit.OP op, String owner) {
}

@Transactional
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above. I don't think there is any need to add transaction annotations here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes,i think is so

@codecov-commenter
Copy link

Codecov Report

Merging #4551 (b409b16) into master (e690e65) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #4551      +/-   ##
============================================
- Coverage     53.30%   53.27%   -0.04%     
  Complexity     2710     2710              
============================================
  Files           495      495              
  Lines         15438    15438              
  Branches       1599     1599              
============================================
- Hits           8229     8224       -5     
- Misses         6648     6655       +7     
+ Partials        561      559       -2     
Impacted Files Coverage Δ
...rip/framework/apollo/biz/service/AuditService.java 78.57% <ø> (ø)
...ork/apollo/portal/service/AppNamespaceService.java 66.00% <ø> (ø)
.../defaultimpl/DefaultRoleInitializationService.java 87.36% <ø> (ø)
...work/apollo/biz/message/DatabaseMessageSender.java 56.25% <0.00%> (-8.34%) ⬇️
...ework/apollo/internals/RemoteConfigRepository.java 85.27% <0.00%> (-2.46%) ⬇️
...ervice/service/ReleaseMessageServiceWithCache.java 87.05% <0.00%> (+1.17%) ⬆️
.../apollo/internals/RemoteConfigLongPollService.java 78.44% <0.00%> (+1.19%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@nobodyiam nobodyiam merged commit b344d54 into apolloconfig:master Sep 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2022
@nobodyiam nobodyiam added this to the 2.1.0 milestone Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants