cuiyapu opened a new issue, #20074:
URL: https://github.com/apache/shardingsphere/issues/20074
use version 5.1.2
batch insert SQL :
INSERT INTO T_USER( id, city, name, year) VALUES
(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)
error info:
{
"timestamp": "2022-08-11T06:46:00.912+0000",
"status": 500,
"error": "Internal Server Error",
"message": "\r\n### Error updating database. Cause:
java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 3\r\n### The error may exist in
file
[D:\\workSpace_run\\Sharding-Demo6\\target\\classes\\com\\fangjia\\sharding\\dao\\mapping\\UserMapper.xml]\r\n###
The error may involve defaultParameterMap\r\n### The error occurred while
setting parameters\r\n### SQL:
INSERT INTO T_USER( id, city, name, year) VALUES
(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)
### Cause: java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 3\n; uncategorized
SQLException; SQL state [99999]; error code [17041]; 索引中丢失 IN 或 OUT 参数:: 3;
nested exception is java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 3",
"path": "/batchAdd"
}
one insert is ok , and mysql batch insert is ok . But oracle batch insert
throw exception .
config:
spring:
profiles: dev
shardingsphere:
props:
sql:
show: true
#配置第 1 个数据源
datasource:
names: ds-2021,ds-2022
ds-2021:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@192.168.31.198:1521:orcl
username: process
password: process
# 配置第 2 个数据源
ds-2022:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@192.168.31.198:1521:orcl
username: process1
password: process1
# 配置分片规则和分片算法
rules:
# 配置分片规则
sharding:
tables:
# 配置 t_order 表规则
t_user:
# actualDataNodes: ds$->{year}.t_user
# 配置分库策略
databaseStrategy:
standard:
shardingColumn: year
shardingAlgorithmName: dbstrategy
tableStrategy:
none:
keyGenerateStrategy:
column: id
keyGeneratorName: snowflake
# 配置分片算法
defaultDatabaseStrategy:
standard:
shardingColumn: year
shardingAlgorithmName: dbstrategy
defaultTableStrategy:
none:
shardingAlgorithms:
dbstrategy:
type: INLINE
props:
algorithm-expression: ds-$->{year}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
workerId: 123
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]