You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Benchao Li (Jira)" <ji...@apache.org> on 2023/07/29 08:49:00 UTC
[jira] [Resolved] (CALCITE-5841) Improve the logic of creating JDBCMeta singleton in calcite plus
[ https://issues.apache.org/jira/browse/CALCITE-5841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benchao Li resolved CALCITE-5841.
---------------------------------
Fix Version/s: 1.36.0
Resolution: Fixed
Fixed via https://github.com/apache/calcite/commit/e3310c2e8201ea2910250a12032186bb45c2b8a2
[~taoran] Thanks for your contribution!
> 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
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.36.0
>
>
> 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)