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

Drive reconnect ignores default database/schema setting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0.6
    • Fix Version/s: 3.0.8
    • Component/s: Failover
    • Labels:
      None
    • Environment:
      Ubuntu 20.04, Mariadb 10.6.9, Galera Cluster - 3 nodes, Apache Tomcat + Tomcat JDBC Connection Pool, OpenJDK 18.0.2

      Description

      I have following connection settings in tomcat's server.xml:

      <Resource auth="Container"
                        name="jdbc/necy-write"
                        username="###"
                        password="###"
                        type="javax.sql.DataSource"
                        driverClassName="org.mariadb.jdbc.Driver"
                        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
                        jdbcInterceptors="ConnectionState"
                        defaultAutoCommit="false"
                        defaultReadOnly="false"
                        maxActive="50"
                        maxIdle="20"
                        maxWait="1000"
                        initialSize="5"
                        minIdle="2"
                        removeAbandoned="true"
                        rollbackOnReturn="true"
                        testOnBorrow="true"
                        maxAge="300000"
                        useStatementFacade="false"
                        url="jdbc:mariadb:sequential://localhost:###,###:###,###:###"
                        defaultCatalog="necy"
                        connectionProperties="
                          allowMultiQueries=true;
                          rewriteBatchedStatements=true;
                          useAffectedRows=true;
                          useServerPrepStmts=false;
                          useBulkStmts=false;
                        "
                        validationQuery="SELECT 1"
              />
      

      There is default database / schema settings - defaultCatalog="necy". This is sometimes ignored by j/connector.

      First I have error (this is as it should be):
      java.lang.InterruptedException: Driver has reconnect connection after a communications link failure with address=(host=###)(port=###)(type=primary). In progress transaction was lost

      It seems driver somehow reconnects but without setting default database because I have ful log of following errors:

      java.util.concurrent.CompletionException: java.lang.InterruptedException: (conn=31) No database selected

      I think it is j/connector bug because error message come from MultiPrimaryClient.java file.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            PavelCibulka Pavel Cibulka
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.