lightningl opened a new issue #8182:
URL: https://github.com/apache/shardingsphere/issues/8182
I use Spring Boot 2.x together with mybatis and sharding-jdbc 4.1.0.
There is only one database, some tables need to sharding, and others are
not.
There are total 5 tables: t_1, t_2, t_3, t_model, t_template. t_1, t_2, t_3
need to do sharding, the other two do not need. Configuration are follows:
spring:
shardingsphere:
datasource: &dataSource
names: ds0
ds0:
jdbc-url: jdbc:mysql://xxxx:3306/xxxx
username: xxxx
password: xxxx
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
sharding:
default-data-source-name: ds0
binding-tables: t_1, t_2, t_3
tables:
t_1:
actual-data-nodes: ds0.t_1_$->{0..9}
database-strategy:
inline:
sharding-column: shard
algorithm-expression: ds0
table-strategy:
inline:
sharding-column: shard
algorithm-expression: t_1_$->{shard % 10}
t_2:
actual-data-nodes: ds0.t_2_$->{0..9}
database-strategy:
inline:
sharding-column: shard
algorithm-expression: ds0
table-strategy:
inline:
sharding-column: shard
algorithm-expression: t_2_$->{shard % 10}
t_3:
actual-data-nodes: ds0.t_3_$->{0..9}
database-strategy:
inline:
sharding-column: shard
algorithm-expression: ds0
table-strategy:
inline:
sharding-column: sharding
algorithm-expression: t_3_$->{shard % 10}
the question is, when I insert a piece of data into table "t_model" and
"t_template", "t_model" can work successfully, but "t_template" throws an
exception:

It looks like the default datasource configuration does not work
effectively. How do I fix it?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]