当前使用版本(必须填写清楚,否则不予处理)


   <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.0.1</version>
        </dependency>

该问题是怎么引起的?(最新版上已修复的会直接close掉)

调用 saveBatch

重现步骤

报错信息

2019-09-20 15:28:53.870 ERROR 16564 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Cannot execute saveBatch Method. Cause] with root cause

com.microsoft.sqlserver.jdbc.SQLServerException: The statement must be executed before any results can be obtained.

Comment From: qmdx

sql server 好像低版本驱动有bug不支持这种批量操作,你试试升级驱动

Comment From: 18818542910

  <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>7.4.1.jre8</version>
        </dependency>

切换到这个版本mybatis plus 好像不支持 目前使用的是 6.2.2.jre8

Comment From: 18818542910

我需要切换至哪个版本呢?

Comment From: qmdx

sql server 驱动是存在该问题 要么你 for 循环 save 如果发现什么原因欢迎 pr

Comment From: biubiue

哥们,怎么解决的呢,用的哪个版本

Comment From: zhenyuqianyezg

哥们,你们是怎么解决的呀

Comment From: liu-xinhui

8.1.0.jre8-preview和7.4.1.jre8这是目前最新的驱动都不行

Comment From: bibichuan

这个问题还解决吗?还是不解决了?