Results 3 comments of bearxsh

好像是sharding-jdbc的问题,其4.1.1版本不支持savepoint操作,sharding-jdbc从5.1.1版本开始支持savepoint操作,你可以升级下试试。 原因:seata在执行savepoint操作前,会先检查connction是否支持savepoint操作。sharding-jdbc 4.1.1版本不支持savepoint操作,按理说在检查时会返回false,但是如果使用的mysql驱动,检查操作会返回true,这就导致seata误以为connction支持savepoint,从而在执行savepoint操作时报错。 https://github.com/apache/shardingsphere/pull/16434

> > > > 好像升级到 5.1.1 也不行。还是会报错。另外 sharding5.1.1版本对 savepoint好像还是不支持,shardingjdbc 官网里的不支持项好像就有 savepoint > > https://shardingsphere.apache.org/document/5.1.1/cn/user-manual/shardingsphere-jdbc/unsupported/ 你是关闭sharding-jdbc的autoCommit了吗?默认是开启的,根本不会执行savepoint操作。我这边测试是可以正常执行的。