cwpgh
cwpgh
最新的2.0.2版本还是获取全部链接, 我是配置的读写分离+分表,发现从库复制失败了,查看日志是ddl语句的问题,最后看源码才发现问题, ShardingConnection 类这里有判断是读写分离的获取全部数据源,数据源 Map dataSources; if (dataSource instanceof MasterSlaveDataSource) { dataSources = ((MasterSlaveDataSource) dataSource).getAllDataSources(); } else { dataSources = new HashMap(1, 1); dataSources.put(dataSourceName, dataSource); } // 循环数据源,返回链接集合 for (Entry...
嗯,确实没看faq,我是在测试过程中,发现数据都到一个分片去了
一。分片列写在左侧问题 1。分片列在左侧 查询语句 SELECT * FROM t_order o where o.order_id=12 limit 10 分片结果 SELECT * FROM t_order_0 o where o.order_id=12 limit 10 2.分片列写在右侧 查询语句 SELECT * FROM t_order o where...
测试代码如下:如果线程池关闭失败,就不能处理后续多用户请求 ```java import java.util.ArrayList; import java.util.List; import io.shardingjdbc.core.constant.SQLType; import io.shardingjdbc.core.executor.BaseStatementUnit; import io.shardingjdbc.core.executor.ExecuteCallback; import io.shardingjdbc.core.executor.ExecutorEngine; import io.shardingjdbc.core.executor.type.statement.StatementUnit; import io.shardingjdbc.core.jdbc.core.connection.ShardingConnection; import io.shardingjdbc.core.jdbc.core.statement.ShardingStatement; import io.shardingjdbc.core.routing.SQLExecutionUnit; public final class Test { static boolean success=false;//是否可以成功关闭...
我知道这是内部类,我写这个只是模仿这个场景 ```java public void renew(final ShardingRule newShardingRule, final Properties newProps) throws SQLException { ShardingProperties newShardingProperties = new ShardingProperties(null == newProps ? new Properties() : newProps); int originalExecutorSize = shardingProperties.getValue(ShardingPropertiesConstant.EXECUTOR_SIZE); int...