批量新增数据是SaveBatch,数量较大时报错

Blade 未结 1 1103

一、该问题的重现步骤是什么?

1. image.png

2. 

[400],JSON parse error: Cannot construct instance of `com.qianfang.mas.sync.vo.ProductUploadVO` (although at least one Creator exists): no int/Int-argument constructor/factory method to deserialize from Number value (1); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.qianfang.mas.sync.vo.ProductUploadVO` (although at least one Creator exists): no int/Int-argument constructor/factory method to deserialize from Number value (1)

 at [Source: (PushbackInputStream); line: 1, column: 1]。



二、你期待的结果是什么?实际看到的又是什么?

2000条数据以内正常,数据大后就报错


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

springboot    mybatis-plus windwos10


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

1条回答
  • 2020-07-16 11:38

    xss添加了放行,数据可以批量新增了,

    配置了

    rewriteBatchedStatements=true

    这个参数,但是看到编译器运行时还是逐条insert

    image.png

    而不是insert .. values()()()这种形式一次提交

    作者追问:2020-07-16 15:16

    mybatis-plus自带的方法就是这样的

    0 讨论(1)
提交回复