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

seataXA模式全局事务中各分支事务更新无法全局事务下可见 #7123

Open
pinganyisheng opened this issue Jan 21, 2025 · 2 comments

Comments

@pinganyisheng
Copy link

环境:springboot2.7.18单体应用,seata2.2.0,druid1.2.24
问题:seataXA模式全局事务中多个数据源切换
1、在不使用spring Transaction的前提下更新了一条数据,在接着查询使用,查询到的数据依然是更新前数据
2、搭配使用spring Transaction时,在Transaction包含范围内,更新数据后,sql查询后为更新后数据,在transaction之外查询数据,依然为更新前数据;
综上,seataXA模式全局事务中各分支事务更新无法全局事务下可见

@funky-eyes
Copy link
Contributor

XA属于数据库自身的分布式事务协议,Seata只是统一管控和代理多个XA事务begin及统一提交和回滚,你理解这个XA事务就是一个持久化的未提交的本地事务状就行了,跨事务本身就犹豫隔离级别原因存在不可见的情况
XA is a distributed transaction protocol specific to the database itself. Seata is just a unified controller and proxy for multiple XA transactions, managing the beginning, commit, and rollback of these transactions. You can think of an XA transaction as a persistent, uncommitted local transaction. Since it spans multiple transactions, it inherently involves invisible situations due to isolation level reasons.

@pinganyisheng
Copy link
Author

好的,谢谢

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

No branches or pull requests

2 participants