apache / apache/incubator-seata

seata 1.3.0 XA模式,直接使用 `@Transactional` 方法报错,

Open
#6,057 3 comments 0 reactions 0 assignees View on GitHub
status: waiting-for-feedback
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

引入的seata后,使用xa模式,直接调用本地事务,不走分布式事务,报错 看上去是直接向tc注册时,但是没有xid,
可是我只使用本地事务,并不走全局事务啊
```java
@Transactional
@Override
public void updateUserRole(Long userId) {

//更新数据...

}
```
项目里有很多老的方法都是直接使用 `@Transactional` 本地事务的,有遇到过的吗

报错信息:
```java
Caused by: java.sql.SQLException: failed to register xa branch null since GlobalTransactionNotExist:Response[ TransactionException[Could not found global transaction xid = null, may be has finished.] ]
at io.seata.rm.datasource.xa.ConnectionProxyXA.setAutoCommit(ConnectionProxyXA.java:137)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:287)
... 99 common frames omitted
Caused by: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = null, may be has finished.] ]
at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:69)
at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96)
at io.seata.rm.datasource.xa.ConnectionProxyXA.setAutoCommit(ConnectionProxyXA.java:133)
... 100 common frames omitted
```

Contributor guide

Open the contributing guide

Research direction

Start with the reported stack-trace entry points, io.seata.rm.datasource.xa.ConnectionProxyXA.setAutoCommit and org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin. Reproduce the @Transactional-only path in XA mode and trace why branch registration receives a null xid. Done means the local transaction path no longer fails, or the expected limitation and required configuration are documented with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.