You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/12/09 07:43:31 UTC

[GitHub] [incubator-shardingsphere] chyangxi opened a new issue #3693: 默认数据源的表和字典表关联查询报错

chyangxi opened a new issue #3693: 默认数据源的表和字典表关联查询报错
URL: https://github.com/apache/incubator-shardingsphere/issues/3693
 
 
   ## Question
   
   (default-data-source-name)table join (broadcast-table) error
   
   ## Content
   <bean id="dbShardingRule" class="com.aop.ShardingDatabaseRule" />
   
   <!-- 分表的策略 -->
   	<sharding:standard-strategy id="databaseStrategy" sharding-column="buss_num" precise-algorithm-ref="dbShardingRule" />
   	
   	<sharding:data-source id="shadingDataSource">
   		<sharding:props>
      			<prop key="sql.show">true</prop>
     		</sharding:props>
   		<sharding:sharding-rule data-source-names="ds0,ds1" default-data-source-name="ds0">
   			<sharding:table-rules>
   				<sharding:table-rule logic-table="user" actual-data-nodes="ds$->{0..1}.user"
   				 database-strategy-ref="databaseStrategy" />
   				<sharding:table-rule logic-table="classes" actual-data-nodes="ds$->{0..1}.classes"
   				 database-strategy-ref="databaseStrategy" />
   				 <sharding:table-rule logic-table="mark" actual-data-nodes="ds$->{0..1}.mark"
   				 database-strategy-ref="databaseStrategy" />
   			</sharding:table-rules>
   			<!-- 绑定表与表的关系,避免笛卡尔积式找表 -->
   			<sharding:binding-table-rules>
                   <sharding:binding-table-rule logic-tables="user,classes,mark" />
               </sharding:binding-table-rules>
               <!--广播表   类似字典表,每个库里一份  找本库数据即可  -->
   			<sharding:broadcast-table-rules > 
   				<sharding:broadcast-table-rule table="school_config"/>
   			</sharding:broadcast-table-rules>
   		</sharding:sharding-rule>
   	</sharding:data-source>
   
   
   
   exception:
   org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error updating database.  Cause: org.apache.shardingsphere.core.exception.ShardingException: Cannot find table rule and default data source with logic tables: '[inter_user , school_config]'
   ### The error may involve com.inter_user .deleteImportData-Inline
   ### The error occurred while setting parameters
   ### SQL: delete from inter_user where date = ? and school IN (SELECT SLAVE_ID FROM   school_config WHERE PARENT_ID = ?)
   ### Cause: org.apache.shardingsphere.core.exception.ShardingException: Cannot find table rule and default data source with logic tables: '[inter_user , school_config ]'
   
   version:
   <dependency>
   			<groupId>org.apache.shardingsphere</groupId>
   			<artifactId>sharding-jdbc-core</artifactId>
   			<version>4.0.0-RC2</version>
   </dependency>
   麻烦指导一下,请问是我配置的不对,还是怎么样?
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services