shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Missing the data source name: 'ds0.5'

Open jie04baichi opened this issue 8 years ago • 1 comments

Question

Error updating database. Cause: java.lang.IllegalStateException: Missing the data source name: 'ds0.5'

The error may involve com.paas.demo.dao.UserInfoMapper.insert-Inline

The error occurred while setting parameters

SQL: insert into user_info (user_id, user_name, account, password) values (?, ?, ?, ?)

Cause: java.lang.IllegalStateException: Missing the data source name: 'ds0.5'] with root cause

rules:sharding.jdbc.config.sharding.tables.user_info.database-strategy.inline.algorithm-expression=ds$->{user_id % 4 / 2}

jie04baichi avatar Dec 05 '18 03:12 jie04baichi

config issue, please try to understand config rule, make sure sharding algorithm result can match data source name

terrymanu avatar Dec 05 '18 10:12 terrymanu