apache / apache/incubator-seata

seata 1.6.1 MP批量Insert 不支持(Client DB:Oracle 11g)

Open
#7,268 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

版本信息:
Seata版本 1.6.1(My SQL DB)
Client端DB:Oracle 11g
后端框架:SpringBoot 2.6.13
持久层:MybatisPlus 3.5.6
JDK:1.8

目前使用仅单笔insert能回滚(PS:使用MP的批量insert方法,无法执行,报错Cause: java.sql.SQLException: Error…registerReturnParamsForAutoKey)
测试过写INSERT ALL INTO,能执行,不能回滚

请教一下是否已经有哪个版本支持使用MP自带的Insert方法,批量Insert可执行,可回滚?(Client:Oracle DB)

以下是两种情况的详细说明

1. MP insert 无法正常执行
![Image](https://github.com/user-attachments/assets/3afd4758-828a-457c-b323-c03138e12120)

![Image](https://github.com/user-attachments/assets/7e8625ca-fc00-46ed-bd0f-b9941aaddfc5)

2. MP 使用insert into all SQL

![Image](https://github.com/user-attachments/assets/a368ba16-219e-49e5-81a0-9ea24cc8d675)
有seata的日志,显示will not be managed by Spring
![Image](https://github.com/user-attachments/assets/7605c3e8-f896-42ab-948d-67e466c40896)
但debug时,并没有写入Undo_log表&seata回滚后,数据未回滚
日志显示Rollbacked
![Image](https://github.com/user-attachments/assets/ab234703-889d-431e-8b95-c3f8551670e6)

![Image](https://github.com/user-attachments/assets/551100ba-e1a0-414a-a168-90f07c2f2706)

麻烦解答一下,十分感谢!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the MyBatis-Plus batch insert and INSERT ALL cases with Seata 1.6.1, Oracle 11g, Spring Boot 2.6.13, MyBatis-Plus 3.5.6, and JDK 8. Inspect the reported registerReturnParamsForAutoKey error, Seata logs, and undo_log behavior. Done means batch inserts execute and rollback correctly, with the relevant behavior verified after rollback.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
databases, 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.