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 2021/06/22 03:12:52 UTC
[GitHub] [shardingsphere] trycache0828 opened a new issue #10901: Sharding-JDBC 4.1.1:The number of query records is normal, and the query result is empty.
trycache0828 opened a new issue #10901:
URL: https://github.com/apache/shardingsphere/issues/10901
## Question
When I changed the datasource for JdbcTemplate to ShardingDataSource,The number of query records is normal, and the query result is empty.But if it is not set, the result is normal.
![jdbcTemplate20210622110142](https://user-images.githubusercontent.com/14318621/122856909-3844b680-d34a-11eb-881c-c70b3a442e3a.png)
## Usage scenarios
Spring 3.x + Hibernate 4.x + Sharding-JDBC 4.1.0
## TODO Code
DataSource dataSource = null;
try {
dataSource = ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfig,
buildShardingsphereProperties());
} catch (SQLException e) {
e.printStackTrace();
}
Logger.msg(String.format("datasource : {%s}", dataSource));
return dataSource;
## Related issues
some pertinent questions:https://github.com/apache/shardingsphere/issues/10843
--
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
[GitHub] [shardingsphere] trycache0828 commented on issue #10901: Sharding-JDBC 4.1.1:The number of query records is normal, and the query result is empty.
Posted by GitBox <gi...@apache.org>.
trycache0828 commented on issue #10901:
URL: https://github.com/apache/shardingsphere/issues/10901#issuecomment-867308724
> @trycache0828 Can you try the latest `5.0.0-beta` version? 4.1.1 is a historical version and will not be maintained.
I would like to upgrade the middleware version.But now the configuration parameters of the new version of middleware are not familiar, and the project is also in a hurry.At present, the simple configuration of integration test has not passed.
## Dependency package
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>5.0.0-beta</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>5.0.0-beta</version>
</dependency>
## Reference example
## 5.x配置项
props:
sql-show: true
dataSources:
ds:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: ${spring.datasource.driver-class-name}
jdbcUrl: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
rules:
# 默认数据源
defaultDataSourceName: ds
tables:
t_user0:
actualDataNodes : ds.t_user$->{0..1}
tableStrategy:
standard:
shardingColumns: test_age
shardingAlgorithmName: t_user_tb_inline
shardingAlgorithms:
t_user_tb_inline:
type: INLINE
props:
algorithm-expression: t_user$->{test_age % 2}
--
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
[GitHub] [shardingsphere] strongduanmu commented on issue #10901: Sharding-JDBC 4.1.1:The number of query records is normal, and the query result is empty.
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10901:
URL: https://github.com/apache/shardingsphere/issues/10901#issuecomment-867301245
@trycache0828 Can you try the latest `5.0.0-beta` version? 4.1.1 is a historical version and will not be maintained.
--
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
[GitHub] [shardingsphere] trycache0828 commented on issue #10901: Sharding-JDBC 4.1.1:The number of query records is normal, and the query result is empty.
Posted by GitBox <gi...@apache.org>.
trycache0828 commented on issue #10901:
URL: https://github.com/apache/shardingsphere/issues/10901#issuecomment-871053661
> @trycache0828 Can you try the latest `5.0.0-beta` version? 4.1.1 is a historical version and will not be maintained.
Can we solve this problem without upgrading the middleware version? Leaders are not allowed to upgrade 4.1.1 version to 5.0.0-beta version.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] trycache0828 closed issue #10901: Sharding-JDBC 4.1.1:The number of query records is normal, and the query result is empty.
Posted by GitBox <gi...@apache.org>.
trycache0828 closed issue #10901:
URL: https://github.com/apache/shardingsphere/issues/10901
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org