PaleWhiteDot opened a new issue, #10419:
URL: https://github.com/apache/shardingsphere/issues/10419
## Version information
springBoot:2.1.4.RELEASE
shardingSphere:5.0.0-alpha
database: oracle
## Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
## config
```
props:
sql-show: true
dataSources:
ds0: !!com.zaxxer.hikari.HikariDataSource
driverClassName: oracle.jdbc.driver.OracleDriver
jdbcUrl: jdbc:oracle:thin:@//******/message
username: MSG_CONNECT
password: *******
ds1: !!com.zaxxer.hikari.HikariDataSource
driverClassName: oracle.jdbc.driver.OracleDriver
jdbcUrl: jdbc:oracle:thin:@//******/message
username: MSG_CONNECT
password: ******
rules:
- !SHARDING
tables:
END_ADDR:
actualDataNodes: ds$->{0..1}.END_ADDR1
databaseStrategy:
standard:
shardingColumn: CHNL_TYPE
shardingAlgorithmName: database-inline
MESSAGE:
actualDataNodes: ds$->{0..1}.MESSAGE1
databaseStrategy:
standard:
shardingColumn: CHNL_TYPE
shardingAlgorithmName: database-inline
shardingAlgorithms:
database-inline:
type: SHARDING_MESSAGE
props:
algorithm-class-name:
com.cmb.sharding.shardAlgorithm.CustomerShardingAlgorithm
```
## Description
my oracle username is MSG_CONNECT,oracle table is in schema MSG.i known
shardingjdbc cannot surppot schema,so i set synonyms in oracle.But when i start
up my application that i got the error 'table or views does not exist'.i review
the code and found the follow code in class ShardingMetaDataLoader.load()
```
boolean isCheckingMetaData =
props.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED);
int maxConnectionsSizePerQuery =
props.getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
TableRule tableRule = rule.getTableRule(tableName);
if (!isCheckingMetaData) {
DataNode dataNode =
dataNodes.getDataNodes(tableName).iterator().next();
return
PhysicalTableMetaDataLoader.load(dataSourceMap.get(dataNode.getDataSourceName()),
dataNode.getTableName(), databaseType);
}
```
it according isCheckingMetaData to check PhysicalTableMetaData. i think it
check PhysicalTableMetaData from default schema 'MSG_CONNECT',but my table is
in schema 'MSG',so it throw a error 'table or views does not exist'.
And then i add the setting 'check-table-metadata-enabled=true',it does not
check PhysicalTableMetaData any more.but the next method parallelLoadTables()
will invoke same method of PhysicalTableMetaDataLoader.load() method,but it is
according to future.So at last i will get the same error 'table or views does
not exist' or somethimes time out.
How can i deal with it? i'm trying to set hikari param
schema=msg,connectionInitSql=alter session set current_schema=msg,but it
doesn't work. If shardingjdbc don't check table exist when i start my
application, i think i will run it because i set the synonyms in oracle.
--
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:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]