当前使用版本(必填,否则不予处理)
3.4.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
saveOrUpdateBatch 的参数 entityList 超过1200 个时
重现步骤(如果有就写完整)
package com.baomidou.mybatisplus.extension.service.impl;
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveOrUpdateBatch(Collection entityList, int batchSize) {
TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!");
String keyProperty = tableInfo.getKeyProperty();
Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!");
return SqlHelper.saveOrUpdateBatch(this.entityClass, this.mapperClass, this.log, entityList, batchSize, (sqlSession, entity) -> {
Object idVal = ReflectionKit.getFieldValue(entity, keyProperty);
return StringUtils.checkValNull(idVal)
|| CollectionUtils.isEmpty(sqlSession.selectList(getSqlStatement(SqlMethod.SELECT_BY_ID), entity));
}, (sqlSession, entity) -> {
MapperMethod.ParamMap param = new MapperMethod.ParamMap<>();
param.put(Constants.ENTITY, entity);
sqlSession.update(getSqlStatement(SqlMethod.UPDATE_BY_ID), param);
});
}
这个方法中sqlSession.selectList(getSqlStatement(SqlMethod.SELECT_BY_ID), entity) 会大约被调用1200次,开启oracle的1200次连接
报错信息
Comment From: wdd15359180132
可能是oracle有限制