Ran Tao created CALCITE-5841:
--------------------------------

             Summary: Improve the logic of creating JDBCMeta singleton in 
calcite plus
                 Key: CALCITE-5841
                 URL: https://issues.apache.org/jira/browse/CALCITE-5841
             Project: Calcite
          Issue Type: Improvement
          Components: extensions
    Affects Versions: 1.34.0
            Reporter: Ran Tao
            Assignee: Ran Tao


current the logic of creating JdbcMeta singleton could be not safe in 
multi-thread occasion.

we can add double-checking.
{code:java}
    private static JdbcMeta getInstance() {
      if (instance == null) {
        try {
          instance =
              new JdbcMeta(CalciteConnectionProvider.DRIVER_URL,
                  CONNECTION_PROVIDER.provideConnectionInfo());
        } catch (SQLException | IOException e) {
          throw new RuntimeException(e);
        }
      }
      return instance;
    } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to