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

Connector/J 3.5.10 propagates the prepared statement limit error instead of falling back to a client-side prepared statement

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 3.5.10
    • N/A
    • Other
    • None
    • MySQL using useServerPrepStmts: true option

    Description

      After upgrading MariaDB Connector/J from 2.7.x to 3.5.10, our application started encountering this error:

      Can't create more than max_prepared_stmt_count statements

      While reviewing the 3.5.10 code, I noticed that when ServerPreparedStatement.executeInternal encounters an SQLPrepareException, it falls back to ClientPreparedStatement through clientFailover. However, executeInternalPreparedBatch appears to propagate the exception to the application without the same fallback.

      Is this difference intentional?

      If propagating the exception to the application is a bug, would it be okay for me to submit a PR that adds the same fallback to ClientPreparedStatement for batch execution?

      [ERROR message]

      SQLGrammarException (JPA error)
      cloud not execute batch [(conn=1) Can't create more than max_prepared_stmt_count statements (Current value: 1]

      SQLPrepareException (mariadb connector)
      (conn=1) Can't create more than max_prepared_stmt_count statements (current value: 1)

      org.mariadb.jdbc.export.ExceptionFactory in createException at line 290
      org.mariadb.jdbc.export.ExceptionFactory in create
      org.mariadb.jdbc.message.client.PreparePacket in readPacket at line 75
      org.mariadb.jdbc.client.impl.StandardClient in readPacket
      org.mariadb.jdbc.client.impl.StandardClient in readResults
      org.mariadb.jdbc.client.impl.StandardClient in readResponse
      org.mariadb.jdbc.client.impl.StandardClient in execute
      org.mariadb.jdbc.client.impl.StandardClient in execute
      org.mariadb.jdbc.ServerPreparedStatement in executeBatchPipeline at line 225
      org.mariadb.jdbc.ServerPreparedStatement in executeInternalPreparedBatch at line 208
      org.mariadb.jdbc.BasePreparedStatement in executeBatchInternal
      org.mariadb.jdbc.BasePreparedStatement in executeBatch
      com.zaxxer.hikari.pool.ProxyStatement in executeBatch
      com.zaxxer.hikari.pool.HikariProxyPreparedStatement in executeBatch

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            clack2933 kihwan kim
            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.