chenxk opened a new issue #10449:
URL: https://github.com/apache/shardingsphere/issues/10449


   500+ tables in my Oracle DB.
   When the application running ,  an exception occurred: Exceeded the maximum 
number of open cursors
   
   I found the problem at this class:
   
org.apache.shardingsphere.sql.parser.binder.metadata.column.ColumnMetaDataLoader.load(final
 Connection connection, final String table, final String databaseType) throws 
SQLException
   
   ----------Exception occurred -----------
   try (ResultSet resultSet = 
connection.createStatement().executeQuery(generateEmptyResultSQL(table, 
databaseType))) {
       for (String each : columnNames) {
           
isCaseSensitives.add(resultSet.getMetaData().isCaseSensitive(resultSet.findColumn(each)));
       }
   }
   
   **connection.createStatement()** , created a statement  ,but  do not close .
   
   So i modified  code  as:
   
   Statement statement = connection.createStatement();
       try (ResultSet resultSet = 
statement.executeQuery(generateEmptyResultSQL(table, databaseType))) {
           for (String each : columnNames) {
               
isCaseSensitives.add(resultSet.getMetaData().isCaseSensitive(resultSet.findColumn(each)));
           }
       }
       statement.close();
   
   Fixed the problem !!!
   
   
   **Looking forward to your better solution。**
   
   
   
   ### Which version of ShardingSphere did you use?
   4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   


-- 
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:
[email protected]


Reply via email to