private synchronized void newConnection()

in storage-jdbc/src/main/java/org/apache/rocketmq/schema/registry/storage/jdbc/dialect/GenericDatabaseDialect.java [211:235]


    private synchronized void newConnection() throws SQLException {
        int attempts = 0;
        while (attempts < maxConnectionAttempts) {
            try {
                ++count;
                log.info("Attempting to open connection #{}", count);
                connection = createConnection();
                return;
            } catch (SQLException sqle) {
                attempts++;
                if (attempts < maxConnectionAttempts) {
                    log.info("Unable to connect to database on attempt {}/{}. Will retry in {} ms.", attempts,
                        maxConnectionAttempts, connectionRetryBackoff, sqle
                    );
                    try {
                        Thread.sleep(connectionRetryBackoff);
                    } catch (InterruptedException e) {
                        // this is ok because just woke up early
                    }
                } else {
                    throw sqle;
                }
            }
        }
    }