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 2022/11/03 09:54:49 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue, #21932: Consider optimizing metadata loading exception handle logic

strongduanmu opened a new issue, #21932:
URL: https://github.com/apache/shardingsphere/issues/21932

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   58e912d
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   Start application successfully when I use sharding feature with oracle database
   
   ### Actual behavior
   
   Metadata throw NullPointerException, and I can't get any exception stack info.
   
   <img width="1487" alt="image" src="https://user-images.githubusercontent.com/10829171/199689906-6837bd4e-cfdf-4beb-a8f1-3851352b1ebf.png">
   
   ### Reason analyze (If you can)
   
   At present, when an exception occurs in the `dialectSchemaMetaDataLoader#load` method, only SQLException is caught, which prevents us from using the loadByDefault method to load metadata again. In addition, there are no exceptions other than SQLException recorded in the error log, so we need to optimize the exception handling logic.
   
   ```java
       private static Collection<SchemaMetaData> load(final SchemaMetaDataLoaderMaterial material) throws SQLException {
           Optional<DialectSchemaMetaDataLoader> dialectSchemaMetaDataLoader = DialectSchemaMetaDataLoaderFactory.findInstance(material.getStorageType());
           if (dialectSchemaMetaDataLoader.isPresent()) {
               try {
                   return dialectSchemaMetaDataLoader.get().load(material.getDataSource(), material.getActualTableNames(), material.getDefaultSchemaName());
               } catch (final SQLException ex) {
                   log.error("Dialect load schema meta data error.", ex);
               }
           }
           return loadByDefault(material);
       }
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] tuichenchuxin closed issue #21932: Consider optimizing metadata loading exception handle logic

Posted by GitBox <gi...@apache.org>.
tuichenchuxin closed issue #21932: Consider optimizing metadata loading exception handle logic
URL: https://github.com/apache/shardingsphere/issues/21932


-- 
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