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

feature: support propagation.never, propagation.mandatory, transaction suspend and resume api #2359

Merged
merged 21 commits into from
Mar 20, 2020
Merged

Conversation

lightClouds917
Copy link
Contributor

Ⅰ. Describe what this PR did

1.add propagation about:never,mandatory;
2.optimize the transationTemplate code;

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@lightClouds917 lightClouds917 changed the title feature:add propagation about:never,mandatory,and optimize the transationTemplate code optimize:add propagation about:never,mandatory,and optimize the transationTemplate code Mar 6, 2020
@codecov-io
Copy link

codecov-io commented Mar 6, 2020

Codecov Report

Merging #2359 into develop will decrease coverage by 0.01%.
The diff coverage is 34.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2359      +/-   ##
=============================================
- Coverage      51.75%   51.73%   -0.02%     
- Complexity      2697     2702       +5     
=============================================
  Files            517      518       +1     
  Lines          16788    16819      +31     
  Branches        2030     2035       +5     
=============================================
+ Hits            8688     8701      +13     
- Misses          7289     7306      +17     
- Partials         811      812       +1     
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/io/seata/common/util/StringUtils.java 9.85% <0.00%> (-0.05%) 8.00 <0.00> (ø)
...in/java/io/seata/tm/api/TransactionalTemplate.java 65.48% <30.76%> (-1.18%) 25.00 <1.00> (+1.00) ⬇️
...a/tm/api/transaction/SuspendedResourcesHolder.java 37.50% <37.50%> (ø) 1.00 <1.00> (?)
...java/io/seata/tm/api/DefaultGlobalTransaction.java 67.61% <38.88%> (-6.83%) 24.00 <2.00> (+2.00) ⬇️
.../java/io/seata/tm/api/transaction/Propagation.java 100.00% <100.00%> (ø) 1.00 <0.00> (ø)
...server/store/file/FileTransactionStoreManager.java 57.14% <0.00%> (+0.63%) 30.00% <0.00%> (+1.00%)

@lightClouds917
Copy link
Contributor Author

@CharmingRabbit @zjinlei PTAL

zjinlei
zjinlei previously approved these changes Mar 6, 2020
Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

@zjinlei zjinlei added the Do Not Merge Do not merge into develop label Mar 6, 2020
@booogu
Copy link
Contributor

booogu commented Mar 7, 2020

@CharmingRabbit @zjinlei PTAL

LGTM.
Thanks for your improvement

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@zjinlei zjinlei added this to the 1.2.0 milestone Mar 12, 2020
@lightClouds917
Copy link
Contributor Author

I created a new class SuspendedResourcesHolder,Can be used to temporarily save transaction state for later recovery,when we suspend global transaction ,or change the branchType, Or handle other nesting situations later.

@lightClouds917
Copy link
Contributor Author

@zjinlei @CharmingRabbit @a364176773 PTAL,THS

@zjinlei zjinlei removed the Do Not Merge Do not merge into develop label Mar 15, 2020
@zjinlei zjinlei dismissed their stale review March 15, 2020 13:49

Re-review after conflict resolution

@lightClouds917
Copy link
Contributor Author

@zjinlei @CharmingRabbit @a364176773 PTAL,THS

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LTGM

return business.execute();
}
break;
case REQUIRED:
break;
case NEVER:
if (existingTransaction()) {
throw new TransactionException("Existing transaction found for transaction marked with propagation 'never'");
Copy link
Member

Choose a reason for hiding this comment

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

how about print xid 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.

ok,i will add now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

finished

@slievrly slievrly changed the title optimize:add propagation about:never,mandatory,and optimize the transationTemplate code feature: support propagation.never, propagation.mandatory, suspend and resume Mar 20, 2020
@slievrly slievrly changed the title feature: support propagation.never, propagation.mandatory, suspend and resume feature: support propagation.never, propagation.mandatory, transaction suspend and resume api Mar 20, 2020
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

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.

None yet

8 participants