Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-121

Issue with org.mariadb.jdbc.MySQLConnection.setNetworkTimeout

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.7
    • 1.1.8
    • None
    • None

    Description

      Hi there,

      We were seeing an issue while using MariaDB 1.1.7 and HikariCP (2.2+) together

      I filed a bug here - https://github.com/brettwooldridge/HikariCP/issues/175

      Below is a snippet from the conversation from the above github link

      Regards

      ==========================

      We will implement a workaround for this, but the issue seems to be caused by a bug in the MariaDB driver.

      We call connection.getNetworkTimeout() to determine whether network timeout is supported. If network timeout is not supported, we expect a SQLFeatureNotSupportedException exception (like above) from this call. However, connection.getNetworkTimeout() is simply returning the value 0. Therefore, we are expecting that timeout is supported. Subsequently, we call connection.setNetworkTimeout() and at this point a SQLFeatureNotSupportedException is thrown.

      MariaDB, if it does not support setNetworkTimeout() should also throw SQLFeatureNotSupportedException for getNetworkTimeout(). Please open a bug against the MariaDB JDBC driver. As I said, we will implement a workaround, but this is improper behavior from their driver.

      Exceptions:

      Caused by: java.lang.RuntimeException: Fail-fast during pool initialization
      at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:505)
      at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:163)
      at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:114)
      at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:78)
      ... 46 more
      Caused by: java.sql.SQLFeatureNotSupportedException: Not yet supported
      at org.mariadb.jdbc.internal.SQLExceptionMapper.getFeatureNotSupportedException(SQLExceptionMapper.java:165)
      at org.mariadb.jdbc.MySQLConnection.setNetworkTimeout(MySQLConnection.java:1319)
      at com.zaxxer.hikari.util.PoolUtilities.setNetworkTimeout(PoolUtilities.java:299)
      at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:425)
      at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:504)
      ... 60 more

      Attachments

        Issue Links

          Activity

            People

              massimo.siani Massimo Siani (Inactive)
              ernstriemer Ernst Riemer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.