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

REQUIRED主事务内多个NESTED次事务不提交事务bug #531

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

Alan-pan
Copy link
Contributor

@Alan-pan Alan-pan commented Jul 18, 2023

What kind of change does this PR introduce? (check at least one)

  • Bugfix

The description of the PR:
https://github.com/dynamic-datasource/dynamic-datasource-samples.git
示例代码中,代码内两个service添加事务
@ds("product")
@DSTransactional(propagation = DsPropagation.NESTED)
image
导致最后主事务判断出错仍不提交事务
image-20230718104811196
并且tx不关闭,下次进入锁死
Other information:

@Alan-pan Alan-pan changed the title Tx REQUIRED主事务内多个NESTED次事务不提交事务bug Jul 18, 2023
@huayanYu
Copy link
Member

@ZPZP1 look look

@Alan-pan
Copy link
Contributor Author

image
忘记了,这个是测试提交,所以改成了数据,期望整个事务成功

@ZPZP1
Copy link
Contributor

ZPZP1 commented Jul 18, 2023

正常嵌套事务每层都有一个savepointHolder,正常某层(方法)释放会释放掉整层的savepoint,都释放后会将整层的savepointHolder从集合中清除掉。

@huayanYu
Copy link
Member

所以到底有没有问题啊~

@Alan-pan
Copy link
Contributor Author

有问题,最后主事务不会提交,而是判断仍然有savepoint,等下我截图

@Alan-pan
Copy link
Contributor Author

image
image
image

最后主事务执行,判断仍然有hasSavePoint为true,走释放,但是最后不走提交事务

@ZPZP1
Copy link
Contributor

ZPZP1 commented Jul 18, 2023

嗯嗯,REQUIRED模式下会有这个问题,把这个判断加上吧,相当于把整体事务传播改为nested了。

@Alan-pan
Copy link
Contributor Author

image
image
不提交事务,后果很严重,😄

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

3 participants