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

Remove the strandId when doing generateCombinedTransactionId in TransactionResourceManager #41800

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

rdulmina
Copy link
Contributor

@rdulmina rdulmina commented Nov 30, 2023

Purpose

When there is a separate strand created for a transaction block it registers in the resourceRegistry with its strandID. Finally when we commit the original transaction with the main strand and we look in the resourceRegistry With the main strandID and the results will be zero. Hence, the transaction won’t be committed.

Since resourceRegistry is a map that holds list of BallerinaTransactionContexts for a given transaction block, we can prevent adding strandID to the keys of resourceRegistry which will fix the mismatch because of different strands.

Fixes #41682

Approach

Remove strandId when doing generateCombinedTransactionId in TransactionResourceManager

Samples

Test cases added via ballerina-platform/module-ballerina-sql#698

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

When there is a separate strand created for a transaction block it registers in the `resourceRegistry` with its strandID. Finally when we commit the original transaction with the main strand and we look in the `resourceRegistry` With the main strandID and the results will be zero. Hence, the transaction won’t be committed.

Since  `resourceRegistry` is a  map that holds list of `BallerinaTransactionContext`s for a given transaction block, we can prevent adding strandID to the keys of `resourceRegistry` which will fix the mismatch because of different strands.
@rdulmina rdulmina changed the base branch from master to 2201.8.x November 30, 2023 03:59
@rdulmina rdulmina changed the base branch from 2201.8.x to master November 30, 2023 04:00
@rdulmina rdulmina changed the title Remove strandId when doing generateCombinedTransactionId in TransactionResourceManager Remove the strandId when doing generateCombinedTransactionId in TransactionResourceManager Nov 30, 2023
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a99b983) 76.73% compared to head (8fa2ffa) 76.73%.
Report is 485 commits behind head on master.

Files Patch % Lines
...ntime/transactions/TransactionResourceManager.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #41800   +/-   ##
=========================================
  Coverage     76.73%   76.73%           
- Complexity    52715    52729   +14     
=========================================
  Files          2878     2878           
  Lines        198706   198736   +30     
  Branches      25825    25832    +7     
=========================================
+ Hits         152475   152509   +34     
+ Misses        37804    37801    -3     
+ Partials       8427     8426    -1     

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

@rdulmina rdulmina added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Nov 30, 2023
Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Dec 15, 2023
@rdulmina rdulmina removed the Stale label Dec 17, 2023
Copy link

github-actions bot commented Jan 1, 2024

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Jan 1, 2024
@pcnfernando pcnfernando removed the Stale label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: MySQL Database Not Reflecting Changes Made by Ballerina Transactional Services
4 participants